如何在用户选择他们的选择后在PHP中处理测验

I am designing a quiz application, and i am using a while loop to load the quiz questions and options from the database but i don't really know how to handle the submission of the quiz. I mean how to display the options the users have selected.

My question is how to handle the choices selected by the users?

Here is my code for displaying the quiz questions and options:

<?php $response = mysql_query("SELECT * FROM iq_questions ORDER BY RAND()"); ?>
<form method='POST' id='quiz_form'>
    <?php 
        $counter = 0;
        while($result = mysql_fetch_array($response)){
        $counter = $counter + 1;
    ?>
   <div id="question_<?php echo $result['question_id'];?>" class='questions'>
    <h4 id="question_<?php echo $result['question_id'];?>"><?php echo $counter.".  ".$result['question_name'];?></h4>
    <div class='align'>
       <input type="radio" value="1" id='radio1_<?php echo $result['question_id'];?>' name='<?php echo $result['question_id'];?>'>
       <label id='ans1_<?php echo $result['question_id'];?>' for='1'>A.  <?php echo $result['choice1'];?></label><br/>
       <input type="radio" value="2" id='radio2_<?php echo $result['question_id'];?>' name='<?php echo $result['question_id'];?>'>
       <label id='ans2_<?php echo $result['question_id'];?>' for='1'>B.  <?php echo $result['choice2'];?></label><br/>
       <input type="radio" value="3" id='radio3_<?php echo $result['question_id'];?>' name='<?php echo $result['question_id'];?>'>
       <label id='ans3_<?php echo $result['question_id'];?>' for='1'>C.  <?php echo $result['choice3'];?></label>
       <input type="radio" checked='checked' value="5" style='display:none' id='radio4_<?php echo $result['question_id'];?>' name='<?php echo $result['question_id'];?>'>
    </div><br/>
   </div>
<?php } ?>
<input type="button" id='next<?php echo $result['question_id'];?>' value='Next!' name='question' class='btn btn-success'/>
</form> 

Please i really need help. Thank you.

</div>

You can add the action attribute to the form which will send it to the page upon submission there you will be able to grab all the variables from the form and display them as desired.I believe that would be the recommended practice as well even though it seems you intend for the results to be displayed on the same page as the quiz itself.

<form method='POST' id='quiz_form' action='result_page.php'>

Then display them using post on 'result_page.php'

<?php echo $_POST["question_answer_1"]; ?>

HTML form action attribute