- 1. WeBuilder Portable(高效快速的web代碼編輯器) V11...
- 2. 電騾eMule(P2P下載分享工具) V1.2.0 官方安裝版
- 3. 個(gè)性回帖(全面支持“論壇”、“QQ空間”的彩字代碼...
- 4. 微盤網(wǎng)絡(luò)硬盤客戶端(支持將本地文件分享到新浪微博...
- 5. 八音盒(支持音樂分享,好音樂一起聽) V3.3.6.237 簡(jiǎn)...
- 6. DBank網(wǎng)盤愛同步(文件同步分享上傳工具) V1.1.2.3
- 7. 小嘴巴語(yǔ)音微博 for Android(手機(jī)語(yǔ)音內(nèi)容錄制分享...
- 8. 美圖庫(kù) for Android(支持在線看圖,分享功能) V1.0.1
- 9. 一首歌 for Android (支持手機(jī)分享視聽音樂的軟件)...
- 10. 源代碼統(tǒng)計(jì)工具(支持二十多種代碼格式)最新免費(fèi)下載...
關(guān)于PHP漢字驗(yàn)證碼的實(shí)現(xiàn)代碼分享
<?php
ChineseChar = array("人","出","來","友","學(xué)","孝","仁","義","禮","廉","忠","國(guó)","中","易","白","者","火 ","土","金","木","雷","風(fēng)","龍","虎","天","地", "生","暈","菜","鳥","田","三","百","錢","福 ","愛","情","獸","蟲","魚","九","網(wǎng)","新","度","哎","唉","啊","哦","儀","老","少","日", "月 ","星");
?>
<?php
session_start();
errorMSG = '';
//驗(yàn)證用戶輸入是否和驗(yàn)證碼一致
if(!is_null(_POST['check']))
{
if (strcasecmp(_SESSION['code'],_POST['code'])==0)
errorMSG = "<p style=\"font-size:12px;color:#009900\">驗(yàn)證成功!</p>";
else
errorMSG = "<p style=\"font-size:12px;color:#FF0000\">驗(yàn)證失敗!</p>";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<?php
if(errorMSG){
echo errorMSG;
}
?>
<form action=<?php echo _SERVER['PHP_SELF']?> method=post>
請(qǐng)輸入驗(yàn)證碼:<input type="text" name="code" style="width:
80px"><img src="code.php">
<br>
<input type="submit" name="check" value="提交驗(yàn)證碼">
</form>
</body>
</html>
<?php
include_once("chinesechar.php");
session_start();
// 設(shè)置 content-type
header("Content-type: image/png");
// 創(chuàng)建圖片
im = imagecreatetruecolor(120, 30);
// 創(chuàng)建顏色
fontcolor = imagecolorallocate(im, 255, 255, 255);
bg = imagecolorallocate(im, 0, 0, 0);
// 設(shè)置文字
for(i=0;i<4;i++) text .= ChineseChar[(array_rand(ChineseChar))];
_SESSION['code'] = text;
// 設(shè)置字體
font = 'simkai.ttf';
// 添加文字
imagettftext(im, 18, 0, 11, 21, fontcolor, font, iconv("GB2312","UTF-8",text));
// 輸出圖片
imagepng(im);
imagedestroy(im);
?>
- 1. 教你編寫安全的ASP代碼
- 2. 關(guān)于ASP中大字段在Form中Post出錯(cuò)的解析
- 3. 關(guān)于在ASP程序頁(yè)面中插入excel文件的實(shí)例代碼分享
- 4. ASP程序?qū)崿F(xiàn)自動(dòng)采集程序及入庫(kù)的實(shí)例代碼分享
- 5. ASP一些錯(cuò)誤代碼的解釋說明
- 6. 關(guān)于Session與HashTable制作購(gòu)物車的簡(jiǎn)單實(shí)例代碼分...
- 7. 關(guān)于ASP控制圖片顯示大小的實(shí)例代碼分享
- 8. ASP中定義數(shù)組方法分享
- 9. 關(guān)于ASP組件上傳的三種機(jī)制
- 10. ASP實(shí)現(xiàn)查看ASP文件源碼的函數(shù)代碼分享