Location: PHPKode > projects > Kwalbum > kwalbum/images/submitImage.php
<?php
/**
 * used to verify human registration
 *
 * @version 2.2
 * @package kwalbum
 * @since 2.1: 2008-10-05
 */

session_start();
header("Content-type: image/png");

$width = 250;
$height = 140;
$image = imagecreatetruecolor($width, $height);
$white = imagecolorallocate($image, 255, 255, 255);
$lightyellow = imagecolorallocate($image, 255, 255, 150);
$green = imagecolorallocate($image, 0, 255, 0);

imagefill($image, 1, 1, $white);

// create image based on session cookie set by register page
$str = $_SESSION["REGcharstr"];
for($i = 0; $i < rand(50, 100); $i++)
	imageline($image, rand(5, 15), rand(5, 95), rand(235, 245), rand(5, 95), $lightyellow);
for($i = 0, $j = strlen($str); $i < $j; $i++)
	imagestring($image, 4, 20+($i*30)+rand(-5, 5), 25+rand(1, 25), substr($str, $i, 1), $green);

imagepng($image);
imagedestroy($image);
?>
Return current item: Kwalbum