復(fù)制代碼 代碼如下:<?php /** * vCode(m,n,x,y) m個(gè)數(shù)字 顯示大小為n 邊寬x 邊高y * micxp *jb51.net */ session_start(); vCode(4, 15); //4個(gè)數(shù)字,顯示大小為15

function vCode($num = 4 " /> 黄色国产网站,美女福利在线观看,青青草91久久久久久久久

四虎精品视频-四虎精品成人免费网站-四虎黄色网-四虎国产视频-国产免费91-国产蜜臀97一区二区三区

PHP驗(yàn)證碼函數(shù)代碼(簡(jiǎn)單實(shí)用)

效果圖:


復(fù)制代碼 代碼如下:
<?php  
 /**
 * vCode(m,n,x,y) m個(gè)數(shù)字  顯示大小為n   邊寬x   邊高y
 * micxp
 *jb51.NET
 */ 
session_start();   
vCode(4, 15); //4個(gè)數(shù)字,顯示大小為15 

function vCode($num = 4, $size = 20, $width = 0, $height = 0) {  
    !$width && $width = $num * $size * 4 / 5 + 5;  
    !$height && $height = $size + 10;   
    // 去掉了 0 1 O l 等 
    $str = "23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVW";  
    $code = '';  
    for ($i = 0; $i < $num; $i++) {  
        $code .= $str[mt_rand(0, strlen($str)-1)];  
    }   
    // 畫圖像 
    $im = imagecreatetruecolor($width, $height);   
    // 定義要用到的顏色 
    $back_color = imagecolorallocate($im, 235, 236, 237);  
    $boer_color = imagecolorallocate($im, 118, 151, 199);  
    $text_color = imagecolorallocate($im, mt_rand(0, 200), mt_rand(0, 120), mt_rand(0, 120));   
    // 畫背景 
    imagefilledrectangle($im, 0, 0, $width, $height, $back_color);   
    // 畫邊框 
    imagerectangle($im, 0, 0, $width-1, $height-1, $boer_color);   
    // 畫干擾線 
    for($i = 0;$i < 5;$i++) {  
        $font_color = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));  
        imagearc($im, mt_rand(- $width, $width), mt_rand(- $height, $height), mt_rand(30, $width * 2), mt_rand(20, $height * 2), mt_rand(0, 360), mt_rand(0, 360), $font_color);  
    }   
    // 畫干擾點(diǎn) 
    for($i = 0;$i < 50;$i++) {  
        $font_color = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));  
        imagesetpixel($im, mt_rand(0, $width), mt_rand(0, $height), $font_color);  
    }   
    // 畫驗(yàn)證碼 
    @imagefttext($im, $size , 0, 5, $size + 3, $text_color, 'c://WINDOWS//Fonts//simsun.ttc', $code);  
    $_SESSION["VerifyCode"]=$code;   
    header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");  
    header("Content-type: image/png;charset=gb2312");  
    imagepng($im);  
    imagedestroy($im);  

?>

php技術(shù)PHP驗(yàn)證碼函數(shù)代碼(簡(jiǎn)單實(shí)用),轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 扎西顿珠的个人资料简介| 媳妇的全盛时代| 六字真言颂怙主三宝| 夜生活女王之霞姐| 法证先锋2| 建设工程价款结算暂行办法| 尤勇智的个人资料简介| 米莎巴顿| 鏖战鲁西南| 延边卫视节目表| 欧美变态挠痒痒视频∨k| 笼中之怒| 八年级下册英语外研版| 彭丹最惊艳三部电影在线观看| 陈昭昭| 《克莱默夫妇》| 欧美一级黄色录像| 被侵犯视频| 《速度与激情10》| 美女写真116| 富贵黄金屋国语| 欧美艹| 女同性激烈床戏舌吻戏| 谁的青春不迷茫 电影| 尤克里里谱| 植田圭辅| 光明与黑暗诸神的遗产攻略| 四大名捕 电影| catastrophe翻译| 爱的重生| 性感美女动漫| 扩内需| 小熊购物教学反思| 娄际成| 野性的呼唤国语| 辐射避难所掉脑袋问题答案| 花宵道中1| 一线钟情 电视剧| 沟通能力自我评价| 黑红| 灌篮高手日语版免费观看|