<?php
session_start();
$letters=substr(str_shuffle("ACDJKMNOPSTVWXYZ"),0,4);
$image = imagecreate(40,16);
imagecolorallocate($image, 255, 255, 255);
imagecolorallocate($image, 0, 0, 0);
imagecolorallocate($image, rand(50,175), rand(125,225), rand(125,225));
imagecolorallocate($image, rand(125,225), rand(50,175), rand(125,225));
imageline($image, 0, rand(9,14), 40, rand(2,7), 2);
imagestring($image, 5, 3, 0, " " . $letters[0] . " " . $letters[1], 1);
imageline($image, 0, rand(2,7), 40, rand(9,14), 3);
imagestring($image, 5, 3, 0, $letters[2] . " " . $letters[3], 1);
$_SESSION["md5"] = md5($letters[2] . $letters[0] . $letters[3] . $letters[1]);
header('Content-type: image/png');
imagepng($image);
?> 
