php代码
<?php //Session保存路径 $sessSavePath = dirname(__FILE__)."/data/sessions/"; if(is_writeable($sessSavePath) && is_readable($sessSavePath)){ session_save_path($sessSavePath); } $letter = ""; //获取随机数字 for ($i=0; $i<3; $i++) { $letter .= chr(mt_rand(48,57)); } //获取随机字母 for ($i=0; $i<3; $i++) { $letter .= chr(mt_rand(65,90)); } //重构字符顺序 $strs = str_split($letter); shuffle ($strs); $rndstring = ""; while (list (, $str) = each ($strs)) { $rndstring .= $str; } //获取随机字符 //$letras = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; //for($i=0; $i<6; $i++) { //$rndstring .= chr(mt_rand(48,90)); // $rndstring .= $letras[rand(0, 35)]; //} //如果支持GD,则绘图 if(function_exists("imagecreate")) { //PutCookie("dd_ckstr",strtolower($rndstring),1800,"/"); session_register('dd_ckstr'); $_SESSION['dd_ckstr'] = strtolower($rndstring); $rndcodelen = strlen($rndstring); //图片大小 //$im = imagecreate(85,20); $im = imagecreatefromgif("code.gif"); //字体 $font_type = dirname(__FILE__)."/data/ant1.ttf"; //背景颜色 //$backcolor = imagecolorallocate($im,190,190,120); //边框色 //$iborder = ImageColorAllocate($im, 0x71,0x76,0x67); //字体色 //不支持 imagettftext $fontColor = ImageColorAllocate($im, 0xff,0xff,0xff); //支持 imagettftext $fontColor2 = ImageColorAllocate($im, 0xff,0xff,0xff); //阴影 $fontColor1 = ImageColorAllocate($im, 0x33,0x33,0x33); //杂点背景线 //$lineColor1 = ImageColorAllocate($im, 130,220,245); //$lineColor2 = ImageColorAllocate($im, 225,245,255); //背景线 //for($j=3; $j<=16; $j=$j+3) imageline($im,2,$j,83,$j,$lineColor1); //for($j=2; $j<83; $j=$j+(mt_rand(3, 10))) imageline($im,$j,2,$j-6,18,$lineColor2); //边框 //imagerectangle($im, 0, 0, 84, 19, $iborder); $strposs = array(); //文字 for($i=0;$i<$rndcodelen;$i++){ if(function_exists("imagettftext")){ $strposs[$i][0] = $i*13+6; $strposs[$i][1] = mt_rand(15,18); imagettftext($im, 5, 5, $strposs[$i][0]+1, $strposs[$i][1]+1, $fontColor1, $font_type, $rndstring[$i]); } else{ imagestring($im, 5, $i*13+6, mt_rand(2, 4), $rndstring[$i], $fontColor); } } //文字 for($i=0;$ijpg ->png if(function_exists("imagejpeg")){ header("content-type:image/jpeg\r\n"); imagejpeg($im); }else{ header("content-type:image/png\r\n"); imagepng($im); } ImageDestroy($im); }else{ //不支持GD,只输出字母 ABCD //PutCookie("dd_ckstr","abcd",1800,"/"); session_register('dd_ckstr'); $_SESSION['dd_ckstr'] = "abcd"; header("content-type:image/jpeg\r\n"); header("Pragma:no-cache\r\n"); header("Cache-Control:no-cache\r\n"); header("Expires:0\r\n"); $fp = fopen("./vdcode.jpg","r"); echo fread($fp,filesize("./vdcode.jpg")); fclose($fp); } ?>
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前By尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
4 周前By尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前By尊渡假赌尊渡假赌尊渡假赌
击败分裂小说需要多长时间?
3 周前ByDDD
R.E.P.O.保存文件位置:在哪里以及如何保护它?
3 周前ByDDD

热工具

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

Atom编辑器mac版下载
最流行的的开源编辑器

Dreamweaver Mac版
视觉化网页开发工具

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。