PHP can't iterate through too high or too low
<p>[Disclaimer: I am new to PHP, and I am just learning, so please no flamers, it really   hinders the learning process when one is trying to learn, thank you.]  </p>

<p>The code below runs, the only problem is that it does not tell the user when the number is too high or too low, I am doing something wrong, but I can't see the error?</p>

<pre><code>&lt;?php
//Starts our php document
if (!$number)
//if we have already defined number and started the game, this does not run
{
 Echo"Please Choose a Number 1-100 &lt;p&gt;";
//gives the user instructions
$number = rand (1,100) ;
//creates number
}

else {
//this runs if the game is already in progress
if ($Num &gt;$number)
{
Echo "Your number, $Num, is too high. Please try again&lt;p&gt;";
}
//if the number they guessed is bigger than number,  lets user know,  guess was  high

elseif ($Num == $number)
{
Echo "Congratulations you have won!&lt;p&gt;";
//if the number they guessed was correct it lets them know they won
Echo "To play again, please Choose a Number 1-100 &lt;p&gt;";
$number = rand (1,100) ;
//it then starts the game again by choosing a new value for $number that they can guess
}

else
{
Echo "Your number, $Num, is too low. Please try again&lt;p&gt;";
}
//if the answer is neither correct or to high, it tells them it is too low
}
?&gt; 

&lt;form action = "&lt;?php Echo $_SERVER[’PHP_SELF’]; ?&gt;" method = "post"&gt; &lt;p&gt;
&lt;!--this sends the form back to the same page we are on--&gt;

Your Guess:&lt;input name="Num" /&gt;
&lt;input type = "submit" name = "Guess"/&gt; &lt;p&gt;
&lt;!--Allows the user to input their guess--&gt;

&lt;input type = "hidden" name = "number" value=&lt;?php Echo $number ?&gt;&gt;
&lt;!--keeps passing along the number value to keep it consistent till it is guessed--&gt;

&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
