Example #1
0
<?php

session_start();
include "./include/common.php";
include "./include/comparison.php";
mySession();
verifyComparisonResult();
if ($_SESSION['num_questions'] > 0) {
    ?>
<html>
<body>

<form name=form1 method='post' action=comparison_10.php>
<?php 
    #foreach($_POST as $key => $value){
    #   echo "Name: $key, Value: $value <br/>";
    #}
    if (isset($_SESSION['iscorrect'])) {
        if ($_SESSION['iscorrect']) {
            echo "<H3><font color=green>CORRECT</font></H3>";
        } else {
            echo "<H3><font color=red>Incorrect</font></H3>";
        }
    }
    echo "<p>";
    gen_new_comparison_problem(0, 100);
    ?>
</form>
<script language="javascript">
<!--
document.form1.result.focus()
function formClear()
{
    mySession('__hash__', null);
    if (isset($_POST['__hash__'])) {
        unset($_POST['__hash__']);
    }
    return true;
}