第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

提示,圖像存在錯誤,無法顯示,以下是我的代碼

<?php
???? ?
??? session_start();
?? ?
??? $image=imagecreatetruecolor(200,60);//創(chuàng)建一個寬100,高30的圖片
?? $bgcolor=imagecolorallocate($image,255,255,255);
??? imagefill($image,0,0,$bgcolor);//將白色$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);//數字的內容,隨機生成0-9
????? $x=($i*100/4)+rand(5,10);//坐標來標識隨機數字寫在哪里
????? $y=rand(5,10);
???? imagestring($image,$fontsize,$x,$y,$fontcontent,$fontcolor);//在$image的圖像資源上,畫隨機數字
??? }
*/
? $fontface='FZYTK.TTF';
? $strdb=array('慕','課','網','贊');
? $captch_code='';
?? for($i=0;$i<4;$i++)//增加字母和數字
{
????? $fontcolor=imagecolorallocate($image,rand(0,120),rand(0,120),rand(0,120));
????? $cn=$strdb[$i];
????? $captcha_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++)//增加200個以內的隨機點
{
???? $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);//輸出&image
//end
? imagedestroy($image);//銷毀&image
?>

正在回答

2 回答

謝謝你,我已經改了這個,可是圖片亂碼哎http://img1.sycdn.imooc.com//574ffa4600013f1105640292.jpg

0 回復 有任何疑惑可以回復我~

第一個循環(huán)里面那個變量$captcha_code比前面申明的變量$captch_code多了一個a

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

提示,圖像存在錯誤,無法顯示,以下是我的代碼

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號