OOPS!
You are right on..
I noticed my error after I sent it. The name='guess' was on the input.??
Daaa! it's Monday .. OK!!
This should work:
===================================================
<?
$another = 'a';
if (isset($guess)) $another = 'another';
echo "
<form action='number.php' method='post'>
<BR>
The computer has picked $another number between 1 and 10.<BR>
Guess the number and you win!<BR>
<BR>
Enter your guess:
<input type='text' size='3' NAME='guess'>
<INPUT TYPE='submit' VALUE='Submit my number'>
</form>";

if (isset($guess))
{
        srand((double)microtime()*1000000);
        $number = floor(rand(1,10));

        echo "The number is: $number<BR>";

        if ($guess == $number)
        echo '<BR>You have won!';
  else  echo "<BR>Sorry that wasn't the answer";

}
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to