All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
SQL,Server,2005数据库升级要点和技巧_[SQL,Server教程]
创建索引对SQL语句执行的影响_[SQL,Server教程]
总结asp.net回发或回调参数无效解决方法_[Asp.Net教程]
Delphi带历史信息的菜单实例
SQL Server查询优化方法_[SQL Server教程]
PHP对特殊语句查询结果进行数组排序_php资料_编程技术
ASP.NET,MasterPage,中图片路径的解决办法_[Asp.Net教程]
ASP.NET Remoting体系结构(七)
SQL Server 2000中的触发器使用分析_[SQL Server教程]
Visual,C#多线程参数传递浅析_.net资料_编程技术
Reading number is top 10 pictures
Plump, too plump!2
Kim jong il's mistress, national beauty JinYuJi actor3
Summer is most suitable for young people to travel in China7
接财神,大吉大利,财源滚滚来
乳娘帕梅拉安德森5
a pure sister
2012 national geographic daily picture4
Poor doll, hand job was caught the currently in effect by his dad
Abdominal hit by iron--HangZhou best driver parking save passengers
Discharge accidentally Actresses by the breast3
Download software ranking
Tram sex maniac 2 (H) rar bag13
Sora aoi 120 minutes
尖东毒玫瑰B
WebService在.NET中的实战应用教学视频 → 第3集
Boxer's Top ten classic battle3
WebService在.NET中的实战应用教学视频 → 第5集
Proficient in Eclipse
Kung fu panda - the secret of the teacher
Unix video tutorial2
Unix video tutorial3
aaa published in(发表于) 2013/12/21 22:41:12 Edit(编辑)
用动态网页技术PHP生成验证码图片的源代码_php资料_编程技术

用动态网页技术PHP生成验证码图片的源代码_php资料_编程技术

用动态网页技术PHP生成验证码图片的源代码_php资料_编程技术-你的首页-uuhomepage.com

文件a.php

//checkNum.php
session_start();
function random($len)
{
$srcstr="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
mt_srand();
$strs="";
for($i=0;$i<$len;$i++){
$strs.=$srcstr[mt_rand(0,35)];
}
return strtoupper($strs);
}
$str=random(4); //随机生成的字符串
$width = 50; //验证码图片的宽度
$height = 25; //验证码图片的高度
@header("Content-Type:image/png");
$_SESSION["code"] = $str;
//echo $str;
$im=imagecreate($width,$height);
//背景色
$back=imagecolorallocate($im,0xFF,0xFF,0xFF);
//模糊点颜色
$pix=imagecolorallocate($im,187,230,247);
//字体色
$font=imagecolorallocate($im,41,163,238);
//绘模糊作用的点
mt_srand();
for($i=0;$i<1000;$i++)
{
imagesetpixel($im,mt_rand(0,$width),mt_rand(0,$height),$pix);
}
imagestring($im, 5, 7, 5,$str, $font);
imagerectangle($im,0,0,$width-1,$height-1,$font);
imagepng($im);
imagedestroy($im);
$_SESSION["code"] = $str;
?>

文件b.php

session_start();
echo "";//生成图片
echo $_SESSION["code"];//生成验证码值
?>





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.