BEGIN PHP output

Welcome to the Guessing Machine!

Guess number: 0
END PHP output

Type your guess here:
Then press <ENTER> or <RETURN>


BEGIN PHP output
Guess Number: 0
End PHP Code RESULT
The PHP Code START
<?php
$num_to_guess = 42;
$message = "";
extract($_POST);
$num_tries = (isset($num_tries))?++$num_tries:0;
if ( ! isset($guess)) {
    $message = "Welcome to the Guessing Machine!";
}
elseif ($guess > $num_to_guess) {
    $message = "$guess is too big! Try a smaller number!";
}
else if ($guess < $num_to_guess) {
    $message = "$guess is too small! Try a <font size = \"+3\">larger</font> number!";
}
else { // must be equivalent
    $message = "Well done!";
}
$guess = (int) $guess;
?>
<br /><br /><font color=red face="Arial,Helvetica">BEGIN PHP output</font><br />
<h2>
  <?php
     print $message;
   ?>
</h2>
<br /><font color=red face="Arial,Helvetica">END PHP output</font><br /><br />

<form method="POST">
Type your guess here: <input type="text" name="guess" value="<?php print $guess; ?>" >
                      <input type="hidden" name="num_tries" value="<?php print $num_tries; ?>" >
</form>
<br /><br /><font color=red face="Arial,Helvetica">BEGIN PHP output<br />
Guess Number: <?php print "$num_tries"; ?>