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.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
刺客信條陰影:貝殼謎語解決方案
1 週前ByDDD
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
3 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

Atom編輯器mac版下載
最受歡迎的的開源編輯器

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

禪工作室 13.0.1
強大的PHP整合開發環境

SecLists
SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

SublimeText3漢化版
中文版,非常好用