コードをコピー コードは次のとおりです:
クラス コード
{
var $ width =160 ; //画像の幅
var $hight =40; //画像の高さ
var $red =223;絵
var $green =225 ; //赤
var $blue =227 ;//青
var $pixcolor; 🎜> var $pixred = 242; //赤
var $pixgreen = 168;//緑
var $pixblue = 162; //青
var $txt=null;//検証コードのテキスト
var $txtcode=null;
var $txtsub=null;
var $i=0; var $widthpx=0;
var $highty=0;
var $txtreg=50;
var $txtgreen=30;
function createimage() // 画像を作成し、色を付けます
{
$ this->image = imagecreate( $this->width,$this->hight);
$this->color = imagecolorallocate($this->image,$this->red,$ this->green,$this ->blue);
return imagefill($this->image,0,0,$this->color);
}
function createepix() //干渉要因
{
for($this->i=1;$this->ipixnum;$this->i )
{
$this->widthpx = rand (0,$this->width);
$this->highty = rand(0,$this->hight);
$this->pixcolor = imagecolorallocate($this->image,$this->pixred,$this->pixgreen,$this->pixblue);
imagesetpixel($this->image,$this->widthpx); ,$this->highty, $this->pixcolor);
}
}
function gettxt() //検証コードテキストを作成
{
$this->txt = array(「私」、「愛」、「あなた」、「あなたがた」、「ただ」、「知恵」、「明」、「ファ」、「真実」、「の」、「とても」、「思う」 「、「いいえ」、「知っています」、「に」、「のために」、「何を」、「何を」、「ちょうど」、「はい」、「忘れました」、「いいえ」、「持っています」、「あなた」、 "ye", "Xu"," " on", "世代", "借りている", "お金");
for($this->i=0;$this->ii )
{
$this->sub = $this->txt[rand(0,29)];
$this->txtcode.= $this-> ;sub;
}
$this->txtcode = iconv("GB2312","UTF-8",$this->txtcode);
$_SESSION["code"] = $this ->txtcode; //生成された検証 ID
}
function createstring() //検証コード画像を作成
{
imagettftext($this->image,20,5,0,40 ,$this->pixcolor," C:WINDOWSFontssimsun.ttc ",$this->txtcode);
header("content-type:image/png");
return imagepng($this-> ;image);
imagedestroy( $this->image);
}
function getcodeimage()// 検証コード画像を取得します
{
$this->createimage() ;
$this->gettxt();
$this->createstring();
}
? ;
session_start();
$text->gettxt(); >$text->createpix();
$text->createstring();

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

SublimeText3 英語版
推奨: Win バージョン、コードプロンプトをサポート!

AtomエディタMac版ダウンロード
最も人気のあるオープンソースエディター

Dreamweaver Mac版
ビジュアル Web 開発ツール
