form is not submited after comlection of time

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]

<?php session_start(); $minutes = 1; // Enter minutes $seconds = 0; // Enter seconds $time_limit = ($minutes * 60) + $seconds + 1; // Convert total time into seconds if(!isset($_SESSION["start_time"])){$_SESSION["start_time"] = mktime(date(G),date(i),date(s),date(m),date(d),date(Y)) + $time_limit;} // Add $time_limit (total time) to start time. And store into session variable. ?> #txt { border:2px solid red; font-family:verdana; font-size:16pt; font-weight:bold; background: #FECFC7; width:70px; text-align:center; color:#000000; } <?php include("connection.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&nbsp&nbsp$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]
Sponsor our Newsletter | Privacy Policy | Terms of Service