課程
/后端開發(fā)
/PHP
/PHP實(shí)現(xiàn)驗(yàn)證碼制作
求誰發(fā)下源碼?感激不盡,實(shí)習(xí)代碼中有用到驗(yàn)證碼
2016-06-24
源自:PHP實(shí)現(xiàn)驗(yàn)證碼制作 1-10
正在回答
http://pan.baidu.com/s/1o6pAqOM 密碼: 369x
<?php
session_start();
$image=imagecreatetruecolor(200,60);
$bgcolor=imagecolorallocate($image,255,255,255);
imagefill($image,0,0,$bgcolor);
/*
for($i=0;$i<4;$i++){
$fontsize=6;
$fontcolor=imagecolorallocate($image,rand(0,120),rand(0,120),rand(0,120));
$fontcontent=rand(0,9);
$x=($i*100/4)+rand(5,10);
$y=rand(5,10);
imagestring($image,$fontsize,$x,$y,$fontcontent,$fontcolor);
}
*/
$fontface='FZYTK.TTF';
$strdb=array('慕','課','網(wǎng)','贊');
$captch_code='';
$cn=$strdb[$i];
$captch_code.=$cn;
imagettftext($image,mt_rand(20,24),mt_rand(-60,60),(40*$i+20),mt_rand(30,35),$fontcolor,$fontface,$cn);
$_SESSION['authcode']=$captch_code;
for($i=0;$i<200;$i++){
$pointcolor=imagecolorallocate($image,rand(50,200),rand(50,200),rand(50,200));
imagesetpixel($image,rand(1,199),rand(1,59),$pointcolor);
for($i=0;$i<3;$i++){
$linecolor=imagecolorallocate($image,rand(80,220),rand(80,220),rand(80,220));
imageline($image,rand(1,199),rand(1,59),rand(1,199),rand(1,59),$linecolor);
header('content-type:image/png');
imagepng($image);
imagedestroy($image);
舉報(bào)
各種形態(tài)驗(yàn)證碼核心原理與實(shí)現(xiàn)技巧,講解實(shí)現(xiàn)過程中的技術(shù)難點(diǎn)
1 回答想要源代碼...
4 回答源代碼下載?
2 回答源代碼可以給嗎?
109 回答視頻對(duì)應(yīng)源代碼下載鏈接: http://pan.baidu.com/s/1o6pAqOM 密碼: 369x
72 回答視頻對(duì)應(yīng)源代碼下載鏈接: http://pan.baidu.com/s/1o6pAqOM 密碼: 369x
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2019-01-24
出國(guó)留學(xué)教育培訓(xùn)機(jī)構(gòu)類網(wǎng)站織夢(mèng)模板(帶手機(jī)端) 免費(fèi)源碼下載:http://www.hmpym.cn/moban/1298.html
2016-10-20
http://pan.baidu.com/s/1o6pAqOM 密碼: 369x
2016-06-25
<?php
session_start();
$image=imagecreatetruecolor(200,60);
$bgcolor=imagecolorallocate($image,255,255,255);
imagefill($image,0,0,$bgcolor);
/*
for($i=0;$i<4;$i++){
$fontsize=6;
$fontcolor=imagecolorallocate($image,rand(0,120),rand(0,120),rand(0,120));
$fontcontent=rand(0,9);
$x=($i*100/4)+rand(5,10);
$y=rand(5,10);
imagestring($image,$fontsize,$x,$y,$fontcontent,$fontcolor);
}
*/
$fontface='FZYTK.TTF';
$strdb=array('慕','課','網(wǎng)','贊');
$captch_code='';
for($i=0;$i<4;$i++){
$fontcolor=imagecolorallocate($image,rand(0,120),rand(0,120),rand(0,120));
$cn=$strdb[$i];
$captch_code.=$cn;
imagettftext($image,mt_rand(20,24),mt_rand(-60,60),(40*$i+20),mt_rand(30,35),$fontcolor,$fontface,$cn);
}
$_SESSION['authcode']=$captch_code;
for($i=0;$i<200;$i++){
$pointcolor=imagecolorallocate($image,rand(50,200),rand(50,200),rand(50,200));
imagesetpixel($image,rand(1,199),rand(1,59),$pointcolor);
}
for($i=0;$i<3;$i++){
$linecolor=imagecolorallocate($image,rand(80,220),rand(80,220),rand(80,220));
imageline($image,rand(1,199),rand(1,59),rand(1,199),rand(1,59),$linecolor);
}
header('content-type:image/png');
imagepng($image);
imagedestroy($image);