first off. you might want to use mt_rand(); as I've heard that it is a better randomizer?? Was in the first php tutorials that I got my hands one..
The reason you are getting the same number everytime is that you are using the same seed, everytime. Random with computers isnt really random. There are set algorhythms it uses to determine the next number... by setting a seed to something non-static, like the time() function, you will get different results each time.
I.e.
<?
mt_srand(time());
echo mt_rand(0, 9);
?>
should output a different number from 0-9 everytime it is loaded
(problem with setting it to time() is that the seed only changes everysecond, so if you do it 2x in the same second im pretty sure the number will be the same)