谁知道PHP登陆页面中,如何单击验证图片就能自动刷新?

来源:百度知道 编辑:UC知道 时间:2024/05/28 05:36:08
谁知道PHP登陆页面中,如何单击验证图片就能自动刷新?

<?php
session_start();

header( "Content-type: image/PNG ");

srand((double)microtime()*1000000);
$checknum=rand(999,9999);
$im = imagecreate(60,22);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
$gray = ImageColorAllocate($im, 200,200,200);
$red=imageColorAllocate($im,255,0,0);
imagefill($im,0,0,$gray);

imagestring($im, 10, 10, 5, $checknum, $black);

for($i=0;$i <300;$i++)
{
$randcolor=ImageColorAllocate($im,rand(0,255),rand(0,255),rand(0,255));
imagesetpixel($im, rand()%70 , rand()%30 , $randcolor);

}

for($i=0;$i <6;$i++)
{
imageline($im,rand()%70,rand%30,rand()%70+2,rand()%70-1,$randcolor);
}

$_SESSION[ 'checknum &ap