session_start(); if ($message) { if ($total == $total_copy) { if ($answer == $n1 + $n2) { $correct += 1; $message = "Very good."; } else { $message = "No, that was not the right answer."; } $total += 1; // [1] $message .= " Score now: $correct out $total "; $n1 = rand(-50, 50); $n2 = rand(-50, 50); $question = "What is $n1 + $n2? "; // I already moved in the future with [1] } else { $message = "Sorry, reloads are not allowed. Still $correct out of $total "; $question = "What is $n1 + $n2? "; } } else { session_register("two_message"); session_register("two_n1"); session_register("two_n2"); session_register("two_correct"); session_register("two_total"); $two_message = "Welcome to the game."; $two_n1 = rand(-50, 50); $n2 = rand(-50, 50); $correct = 0; $total = 0; $message .= " Score now: $correct out of $total "; $question = "What is $n1 + $n2? "; } ?>