Add a timer, and keep track of correct/incorrect stats withcookies or session data. Below is the code
Adder.php
<html>
<head>
<title>Math Adder</title>
</head>
<body>
<h3> Addition Quizer </h3>
<form action=”Adder2.php” method=”get”>
<?php
$n1 = rand(0,9);
$n2 = rand(0,9);
?>
<?php echo ($n1) ?> + <?php echo ($n2) ?> =
<input type “text” name=”answer” size=”3″>
<input type=”hidden” name=”n1″ value= “<?php echo ($n1);?>” >
<input type=”hidden” name=”n2″ value= “<?php echo ($n2);?>” >
<br></br>
<input type=”submit” value=”Is that Right?” />
</form>
</body>
</html>
____________________________________
Adder2.php
_______________________________
<html>
<head>
<title>Math Adder 2</title>
</head>
<body>
<h3> Addition Quizer </h3>
<?php
if(isset($_GET[‘n1’])){
$n1 = (int)$_GET[‘n1’];
$n2 = (int)$_GET[‘n2’];
$answer = (int)$_GET[‘answer’];
if($answer == $n1+$n2){
echo $n1 .” + “.$n2.” = “.$answer.” ! It is a correct answer”;
}
else{
echo $n1 .” + “.$n2.” = “.$answer.” ???… Sorry the answer is”.($n1+$n2);
}
}
?>
<h3> Okay, try again… </h3>
<form action=”Adder2.php”
PayPal Gateway not configured
PayPal Gateway not configured