Location: PHPKode > projects > HyperBook Guestbook > verification_image.php
<?php
session_start();

$alphanum  = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$rand = substr(str_shuffle($alphanum), 0, 5);
$bgNum = rand(1, 4);
$image = imagecreatefromjpeg("background$bgNum.jpg");
$textColor = imagecolorallocate ($image, 0, 0, 0);
imagestring ($image, 5, 5, 8,  $rand, $textColor);
$_SESSION['image_random_value'] = md5($rand);
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0 
header("Pragma: no-cache");

header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
?>
Return current item: HyperBook Guestbook