Rand() returns same value; in a hidden input
<p>For some reason if I try to assign a value to my input type hidden then I always get the same value (1), I can assign a value to it with javascript but not php..:</p>

<pre><code>&lt;?php
 $num = rand(1, 4);                     
?&gt;  

 &lt;?php echo $num; ?&gt;&lt;?php echo $num; ?&gt;&lt;?php echo $num; ?&gt;

&lt;input type="hidden" value="&lt;?php echo $num; ?&gt;" name="catch_num1"&gt;
</code></pre>

<p>If rand gave 4 this would give 444 but in input type it would always give value="1"??</p>

<p>It seems like a bug to me but I'm checking all my code in between.</p>
