php随机验证码图片显示不出来
for($i=0;$i<4;$i++){$rand.=dechex(rand(0,15));}header('Content-Type:image/png');$im=i...
for($i=0;$i<4;$i++){
$rand.=dechex(rand(0,15));
}
header('Content-Type: image/png');
$im = imagecreatetruecolor(75,25);
$blue = imagecolorallocate($im,0,102,255);
imagefill($im,0,0,$blue);
$white = imagecolorallocate($im,255,255,255);
//imageline($im,0,0,200,200,$white);
//imageline($im,200,0,0,200,$white);
//imagestring($im,5,0,0,'$rand',$white);
imagepng($im);
imagedestroy($im);
注释掉循环能显示出来 展开
$rand.=dechex(rand(0,15));
}
header('Content-Type: image/png');
$im = imagecreatetruecolor(75,25);
$blue = imagecolorallocate($im,0,102,255);
imagefill($im,0,0,$blue);
$white = imagecolorallocate($im,255,255,255);
//imageline($im,0,0,200,200,$white);
//imageline($im,200,0,0,200,$white);
//imagestring($im,5,0,0,'$rand',$white);
imagepng($im);
imagedestroy($im);
注释掉循环能显示出来 展开
2个回答
展开全部
我来帮你看
已经帮你搞定
直接运行就可以了
<?
for($i=0;$i<4;$i++){
$rand.=dechex(rand(0,15));
}
header('Content-Type: image/png');
$im = imagecreatetruecolor(75,25);
$blue = imagecolorallocate($im,0,102,255);
imagefill($im,0,0,$blue);
$white = imagecolorallocate($im,255,255,255);
imageline($im,0,0,200,200,$white);
imageline($im,200,0,0,200,$white);
imagestring($im,5,0,0,$rand,$white);
imagepng($im);
imagedestroy($im);
?>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询