谁有php的验证码程序??我想要
RT:victory: DZ論壇,PW論壇都有~ 我有生成验证码图片的程序,应该在06年前数据里 我只知道ASP的 原帖由 星辰 于 2006-6-21 21:14 发表DZ論壇,PW論壇都有~
这个太难找了吧! http://www.jgwy.net/bbs/viewthread.php?tid=98346&extra=&highlight=&page=1 原帖由 esnak 于 2006-6-21 21:29 发表
http://www.jgwy.net/bbs/viewthread.php?tid=98346&extra=&highlight=&page=1
谢谢
<?php
session_start();
if($_GET["act"] == "check")
{
$_SESSION['login_check_number'] = substr(md5(rand()),20,6);
for($i=0;$i<5;$i++)
{
if(rand(0,1)) $_SESSION['login_check_number'][$i] = strtoupper($_SESSION['login_check_number'][$i]);
}
session_register("login_check_number");
$im = @imagecreate (86, 20)
or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 200, 200, 200);
//设置干扰像素,防止被OCR
for ($i=0;$i<=128;$i++)
{
$point_color = imagecolorallocate ($im, rand(0,255), rand(0,255), rand(0,255));
imagesetpixel($im,rand(2,128),rand(2,38),$point_color);
}
//逐个画上验证码字符
for ($i=0;$i<=5;$i++)
{
$text_color = imagecolorallocate ($im, rand(0,255), rand(0,128), rand(0,255));
$x = 5 + $i * 14;
$y = rand(1,5);
imagechar ($im, 5, $x, $y,$_SESSION['login_check_number']{$i}, $text_color);
}
//输出PNG图像
header ("Content-type: image/png");
imagepng ($im);
imagedestroy ($im);
die();
}
?> 靠,木JJ的难得显次身。。。 收了
页:
[1]
2