I am working on an quiz page.In this there are radio buttons corresponding to each question.I have to view the status of each question whether answered or not.please give me any solution to do this.
here is my code
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
$rs=mysql_query("select * from question where testid=$tid order by quesid ",$cn) or die(mysql_error());
if($_SESSION[qn]>mysql_num_rows($rs)-1)
{
unset($_SESSION[qn]);
echo "<h1 class=\"head1\">Some Error Occured</h1>";
session_destroy();
echo "Please <a href=\"UserHome.php\"> Start Again</a>";
exit;
}
?>
<form name="myfm" id="myfm" method="post" action="QuizSub.php">
<table width="100%">
<?php
$n=0;
while($row= mysql_fetch_row($rs)){?>
<tr> <td width="30"></td><td></td></tr>
<?php $n=$n+1; ?>
<tr><td>Question <?php echo $n.") ".$row[2]; ?></td></tr>
<tr><td class="style8">A. <input type="radio" name="ques<?php echo $n; ?>[]" value="1"><?php echo $row[3]; ?></td></tr>
<tr><td class="style8">B. <input type="radio" name="ques<?php echo $n; ?>[]" value="2"><?php echo $row[4];?></td></tr>
<tr><td class="style8">C. <input type="radio" name="ques<?php echo $n; ?>[]" value="3"><?php echo $row[5];?></td></tr>
<tr><td class="style8">D. <input type="radio" name="ques<?php echo $n; ?>[]" value="4"><?php echo $row[6];?></td></tr>
<?php
}
echo "<tr><td><input type=\"hidden\" name=\"qncount\" id=\"qncount\" value=\"".$n."\"><input type=\"submit\" name=\"submit\" id=\"result\" value=\"Get Result\"></td></tr>";
?>
</table>
</form>