无为清净楼资源网 Design By www.qnjia.com
image.func.php
<"verify"){ session_start(); /*定义长度和宽度*/ $width=80; $height=30; /* 创建画布*/ $image=imagecreatetruecolor($width, $height); /*本函数用来匹配图形的颜色,供其它绘图函数使用。参数 image 表示图形的 handle。参数 red、green、blue 是色彩三原色,其值从 0 至 255....我在此定义黑色和白色*/ $white=imagecolorallocate($image, 255, 255, 255); $black=imagecolorallocate($image,0,0,0); /*本函数将图片的封闭长方形区域着色。参数 x1、y1 及 x2、y2 分别为矩形对角线的坐标。参数 col 表示欲涂上的颜色*/ imagefilledrectangle($image, 1, 1, $width-2, $height-2, $white); /*buildRandomString函数用来生成一个验证码*/ $chars=buildRandomString($type,$length); /*将验证码给session以便用来判断用户输入是否正确*/ $_SESSION[$sess_name]=$chars; /*定义字体库*/ $fontfiles=array('msyh.ttf','msyhbd.ttf','simsun.ttc','SIMYOU.TTF','STHUPO.TTF','STKAITI.TTF','STLITI.TTF'); /*用循环来将验证码一个一个的写入图片中*/ for($i=0;$i<$length;$i++) { $size=mt_rand(14,18); $angle=mt_rand(-15,15); /*验证码的横坐标与纵坐标*/ $x=5+$i*$size; $y=mt_rand(20,26); $color=imagecolorallocate($image,mt_rand(50,190),mt_rand(50,200),mt_rand(50,90)); $fontfile="../font/".$fontfiles[mt_rand(0,count($fontfiles)-1)]; $text=substr($chars,$i,1); /*本函数将 TTF (TrueType Fonts) 字型文字写入图片*/ imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text); } if($pixel) { for($i=0;$i<50;$i++) { /*本函数可在图片上绘出一点。参数 x、y 为欲绘点的坐标,参数 col 表示该点的颜色*/ imagesetpixel($image, mt_rand(0,$width-1), mt_rand(0,$height-1), $black); }} if($line) { for($i=0;$i<10;$i++) { $color=imagecolorallocate($image,mt_rand(50,90),mt_rand(50,200),mt_rand(50,90)); /*画线段*/ imageline($image, mt_rand(0,$width-1), mt_rand(0,$height-1), mt_rand(0,$width-1), mt_rand(0,$height-1), $color); } } /*以gif形式输出*/ header("content-type:image/gif"); /*建立GIF图 并输出到网页*/ imagegif($image); /*释放与 image 关联的内存*/ imagedestroy($image); }
string.func.php
<"",range(0,9)); }elseif ($type==2) { /*array_merge函数合并数组*/ $chars=join("",array_merge(range("a","z"),range("A","Z"))); }elseif($type==3) { $chars=join("",array_merge(range("a","z"),range("A","Z"),range(0,9))); } if($length>strlen($chars)) { exit("字符串长度不够"); } /*打乱字符串*/ $chars=str_shuffle($chars); return substr($chars,0,$length); } ?>
标签:
php,生成验证码
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?
更新日志
2024年09月24日
2024年09月24日
- 国风大师纯音系列《民乐琴王童丽-与古筝的约会》1CD[MP3][166.4MB]
- 刘美君.1993-被你纵坏【SONY】【WAV+CUE】
- 黄鹤翔.1998-爱的咏叹调【中唱】【WAV+CUE】
- 薰妮.1983-梦+淡(2000年永恒真存双碟版)【永恒】【WAV+CUE】
- 方伊琪.1976-时光消逝(2015复黑限量版)【风行】【WAV+CUE】
- 群星.1990-宝丽金影视金曲巡礼【宝丽金】【WAV+CUE】
- 林俊杰.2014-新地球(精装预售“光”版)【华纳】【WAV+CUE】
- 国风大师纯音系列《王珣学院派独特的空灵古筝》1CD[FLAC][888MB]
- 国风大师纯音系列《古筝演奏家 付娜》1CD[FLAC][1.2GB]
- 国风大师纯音系列《古筝仙子 常静演奏 十指弹一》1CD[FLAC][919MB]
- DasKapital-OneMustHaveChaosInsidetoGiveBirthtoaDancingStar(2024)[24-44.1]WAV
- 王菲.1999-《只爱陌生人》日本东芝版[低速原抓WAV+CUE]
- 张小英1987-金奖金曲第一集[新加坡版][WAV+CUE]
- 鹿晗.2015-重启【海蝶】【FLAC分轨】
- 张芸京.2012-小女孩【金牌大风】【WAV+CUE】