php简单验证码的制作

2015-07-23 0 631
php简单验证码的制作
<?php
$image=imagecreatetruecolor(100, 30);
$white=imagecolorallocate($image, 255, 255, 2);
$red=imagecolorallocate($image, 255, 0, 0);
imagefill($image, 0, 0, $white);
//munber create
$num="";
for($i=0;$i<5;$i++){
    
     $num.=rand(1,9);
}
imagestring($image, 6, rand(10,20), rand(00,10), $num,imagecolorallocate($image, rand(0,100),  rand(100,125),  rand(0,255)) );
for($j=0;$j<200;$j++){
     
     imagesetpixel($image,rand(1,199), rand(1,29), imagecolorallocate($image, 255, 0, 0));
}
for($k=0;$k<5;$k++){
imageline($image, rand(1,99), rand(1,29), rand(1,99), rand(1,29), imagecolorallocate($image,0,255, 0));
}
header("Content-type:image/png");
imagepng($image);
imagedestroy($image);
?>

遇见资源网 php php简单验证码的制作 http://www.ox520.com/7913.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务