Calling Randon Numbers in an Anti Automated Signup Script

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
 
Needed to use srand and needed to seed it first. Also needed to open session.

If you have the same problem message me.
 
Back
Top