大家帮帮忙!!!
悬赏分:20 -
2007年08月22日
code1.php
无标题文档
code2.php
<?
if($_GET["a"]=="ceoofkang")
{
session_start();
session_register('$num');
$code=md5(rand(0,9999));
$num2=substr($code,17,4);
$_SESSION["num"]=$num2;
header("Content-type: image/png");
$imgWidth=50;
$imgHeight=18;
$image=imagecreate($imgWidth, $imgHeight);
$a=imagecolorallocate($image, 0, 0, 0);
$b=imagecolorallocate($image, 225, 225, 222);
$b=imagefill($image,5,10,$a);
$c=imagecolorallocate($image,232,180,112);
srand((double)microtime()*1000000);
imagestring($image,5, 6, 0, $num2, $b);
for($i=0;$i<1000;$i++)
{
imagesetpixel($image, rand()%80 , rand()%80 , $c);
}
imagepng($image);
imagedestroy($image);
}
die();
?>
code1.php运行的时候显示的验证码与$_SESSION["num"]不相同,
$_SESSION["num"]显示的是刷新页面的前验证吗,两个不同步...........
..高手们来看看
提问者:ceoofkang 08-22 08:08