A
Anonymous
Guest
I have a problem with calling a random number.
I have created a page saying:
<img src="images.php"> <img src="images.php"> <img src="images.php"> <img src="images.php">
In theory this will show 4 random numbers as images.php says the following:
<?
header("content-type: image/gif");
session_start();
//$n is randomly selected from 1 - 10
$HTTP_SESSION_VARS['number'] = "'.$HTTP_SESSION_VARS['number'].'".$n;
echo fread(fopen("images/$n.gif","r"),filesize("images/$n.gif"));
exit;
?>
The problem is it does not show any of the images 1.gif etc.
I tried $n = rand (1, 10); but when I did that, it showed the numbers and they are all the same. Has anyone got any ideas?
Cheers
I have created a page saying:
<img src="images.php"> <img src="images.php"> <img src="images.php"> <img src="images.php">
In theory this will show 4 random numbers as images.php says the following:
<?
header("content-type: image/gif");
session_start();
//$n is randomly selected from 1 - 10
$HTTP_SESSION_VARS['number'] = "'.$HTTP_SESSION_VARS['number'].'".$n;
echo fread(fopen("images/$n.gif","r"),filesize("images/$n.gif"));
exit;
?>
The problem is it does not show any of the images 1.gif etc.
I tried $n = rand (1, 10); but when I did that, it showed the numbers and they are all the same. Has anyone got any ideas?
Cheers