header("Content-type: text/html; charset=utf-8");
require_once('wepp/inc/init.php');
$key = (isset($_GET['key']) ? $_GET['key'] : rand(0,9).rand(0,9).rand(0,9).rand(0,9));
$_SESSION["postcode"]=$key;
$ImHandle = ImageCreate(40,19);
$blue = ImageColorAllocate($ImHandle,0xEC,0xED,0xE8);
$white = ImageColorAllocate($ImHandle,0xFF,0xFF,0xFF);
$black = ImageColorAllocate($ImHandle,0xB1,0xB6,0xEC);
ImageFill($ImHandle,0,0,$black);
ImageString($ImHandle,20,2,2, $key, $white);
Header("Content-type: image/PNG");
ImagePNG($ImHandle);
ImageDestroy($ImHandle);
?>