PHP programs need to be placed in htdocs They need to have .php extension Post source code as .phps files A parameter named "n1" is available as $n1 in your script. (This is PHP's shortcut for $q->param('n1') fropm CGI/Perl). Let's do the addition quiz in PHP. The state for this program is made of: a) user score (good answers given) b) number of questions thus far c) n1, n2 (we need to remember them to grade the user's answer) d) message (what we told them last) if ($message) { // there is state, add input to it if ($answer == $n1 + $n2) { $correct += 1; $message = "Very good. "; } else { $answerkey = $n1 + $n2; $message = "No, $n1 + $n2 is $answerkey, not $answer."; } $totalqs += 1; $message .= "Your score is now $correct out of $totalqs"; $n1 = rand(-50, 50); $n2 = rand(-50, 50); } else { // initialize state, because it's missing $totalqs = 0; $correct = 0; $message = "Welcome to the game, your score is: $correct out of $totalqs"; $n1 = rand(-50, 50); $n2 = rand(-50, 50); } ?> echo $message; ?>