get_random.phtml not working with IE 7--HELP!
Posted: Thu Apr 24, 2008 7:15 am
Hi--
I am using the following PHP code to retrieve a random text entry from a msg.dat file, but the code does not seem to work in IE 7 (but does work in FireFox, Mozilla, and Safari). It will generate two entries at random, and then it will continue to show the second entry without randomly picking any more. The code is:
<?php
srand((double)microtime()*1000000);
$filename="msg.dat";
$message=file($filename);
$select=rand(0, count($message)+1);
$msg = "msg=$message[$select]";
echo "$msg";
?>
Does anyone have any idea of why this is happening, and even better, how to fix it? Many, many thanks for any help!!!!
I am using the following PHP code to retrieve a random text entry from a msg.dat file, but the code does not seem to work in IE 7 (but does work in FireFox, Mozilla, and Safari). It will generate two entries at random, and then it will continue to show the second entry without randomly picking any more. The code is:
<?php
srand((double)microtime()*1000000);
$filename="msg.dat";
$message=file($filename);
$select=rand(0, count($message)+1);
$msg = "msg=$message[$select]";
echo "$msg";
?>
Does anyone have any idea of why this is happening, and even better, how to fix it? Many, many thanks for any help!!!!