PHP Guessing Number
<p>This is a random number guessing game between 1 and 100.</p>

<p>I am stuck on the guessing number part. The code doesn't work, whatever number I put it just show me the message "Your number is lower!".I need help.</p>

<p>This is what I have so far.</p>

<pre><code>&lt;?php

$x   = rand(1, 100);
$num = '';

if (isset($_POST['submit'])) {


        if ($num &lt; $x) 
        {
            echo " Your number is lower! &lt;br /&gt;";
        } elseif ($num &gt; $x) 
            {
            echo " Your number is higher! &lt;br /&gt;";
        } elseif ($num == $x) 
            {
            echo " Congratulations! You guessed the hidden number. &lt;br /&gt;";
        } else 
            {
            echo " You never set a number! &lt;br /&gt;";
        }




}
?&gt;
&lt;p&gt;
&lt;form action="" method="post"&gt;
&lt;input type="text" name="num"&gt;
&lt;button type="submit" name="submit"&gt;Guess&lt;/button&gt;
&lt;button type="reset" name="Reset"&gt;Reset&lt;/button&gt;
&lt;/form&gt;
&lt;/p&gt;
</code></pre>