<?
session_start()
header("Content-Type: image/jpeg");
get_checkcode_picture(substr(session_id(), -4 , 4));
die;
function get_checkcode_picture($code){
$img=imagecreatetruecolor(50 , 30);
$x1=0;
$x2=60;
$y1= rand(0,30);
$y2= rand(00,30);
$textcolor = imagecolorallocate($img , 255 , 255 , 255);
imageline($img, $x1, $y1, $x2 ,$y2, $textcolor);
$x1=rand(0,50);
$x2=rand(0,50);
$y1=0;
$y2=30;
imageline($img, $x1, $y1, $x2 ,$y2, $textcolor);
imagestring($img, 4, 10, 7, $code, $textcolor);
imagejpeg($img);
?>