Hi,
Thanks for ur reply. I didn't understand it clearly, please send me a small sample code.
The code i use to generate the image with a random number is:
<?php
$img_number = imagecreate(100, 50);
$white = imagecolorallocate($img_number,255,255,255);
$black = imagecolorallocate($img_number,0,0,0);
$grey_shade = imagecolorallocate($img_number,204,204,204);
imagefill($img_number,0,0,$grey_shade);
ImageRectangle($img_number,5,5,94,44,$black);
ImageRectangle($img_number,0,0,99,49,$black);
$number = get_random();
Imagestring($img_number,9,30,15,$number,$black);
header("Content-type:image/jpeg");
imagejpeg($img_number);
function get_random()
{
srand(time());
$max = getrandmax();
return rand(1,$max) + rand(1,$max) ;
}
?>
I display the image in another php file like this:
<?php echo "<img src=\"random.php\">"; ?>
The php file which contains this contains a user registration form and the values are send to another page. In that page to which the values are sent i must check whether the string which is displayed on the page along with the image is entered by the user correctly.