<?php
session_start();
Header("Pragma: no-cache");
$_SESSION['code'] = '';

for ($i=1;$i<5;$i++)
$_SESSION['code'] .= mt_rand(0,9);

$pic = ImageCreateFromJPEG("img/code.jpg");
Header("Content-type: image/jpeg");
$color=ImageColorAllocate($pic, 0, 0, 0);
ImageString($pic,5,20,25,$_SESSION['code'],$color);
ImageJPEG($pic);
ImageDestroy($pic);

?>
