I am trying to make a test with multiple choice questions
With mysql i get the questions from a database. (the variables used below come from a database)
It self the script below works, but I get all the questions from the database with the answers. I was expecting the INPUT statement to work as a stop, so first answer question 1, before the while function continues.
What do I do wrong? any help is welcome
<form action="" method="post" enctype="multipart/form-data">
<center><table><tr><td>
<center>
<?php
echo "<center><h5>Vraag ".$QuestionNr." luidt: ".$Question." </h5></center><br><br>\n";
?>
</h5> </center>
</td></tr></table> <center>
<center><table>
<tr><td><h5><INPUT type="radio" name="Hquestion" value="1">Keuze 1</h5></td>
<td><h5><?php echo $Answer1;?> </h5></tr>
<tr><td><h5><INPUT type="radio" name="Hquestion" value="2">Keuze 2</h5></td>
<td><h5><?php echo $Answer2;?> </h5></tr>
<tr><td><h5><INPUT type="radio" name="Hquestion" value="3">Keuze 3</h5></td>
<td><h5><?php echo $Answer3;?> </h5></tr>
<tr><td><h5><INPUT type="radio" name="Hquestion" value="4">Keuze 4</h5></td>
<td><h5><?php echo $Answer4;?> </h5></tr>
<BR>
</table> </center>
<table>
<center><tr>
<td><input type="submit" name="Hquestion" value="Antwoord"></td>
</tr> </center>
</table><center>
</table> </center>
</form>
<?php
print "<center>Het goede antwoord was ".$dbanswer." .</center>\n";
print "<center>".$dbexplanation.".</center>\n";
if ($Hquestion == $dbanswer) {
$opl_score=$opl_score+1;
print "<center>Correct, youre score is now ".$opl_score." .</center>\n";
}