I am trying to do php quiz aplication with timer form will submit automatically after complection of time but form is not submited after complection of time
[php]
$display = mysql_query("SELECT * FROM tbl_questions ORDER BY Qno ");
if (!@$_POST['submit']) {
echo "<form method=post action=\" \" name=f1 id=f1>";
echo "<table border=0>";
while ($row = mysql_fetch_array($display))
{
$id = $row["Qno"];
$question = $row["question"];
$opt1 = $row["option1"];
$opt2 = $row["option2"];
$opt3 = $row["option3"];
$opt4 = $row["option4"];
$answer = $row["answer"];
echo "<tr><td colspan=3><br><b>$id  $question</b></td></tr>";
echo "<tr><td><input type=radio name=q$id value=\"$opt1\">$opt1</td><td> <input type=radio name=q$id value=\"$opt2\">$opt2</td><td> <input type=radio name=q$id value=\"$opt3\">$opt3</td><td> <input type=radio name=q$id value=\"$opt4\">$opt4</td></tr>";
}
echo "</table>";
echo "<input type='submit' value='submit' name='submit'>";
echo "</form>";
}
else if($_POST['submit'])
{
//echo"executed";
$score = 0;
$total = mysql_num_rows($display);
while ($result = mysql_fetch_array($display)) {
$answer = $result[“answer”];
$id = $result[“Qno”];
$or=q.$id;
//echo"$or";
if ($_POST[$or] == $answer) {
$score++;
}
}
echo “
You scored $score out of $total
”;}
?>
[/php]