session_start();

$sessi " /> 粉嫩一区二区三区性色av ,欧美日韩中文精品,高清欧美性猛交xxxx

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php 數學運算驗證碼實現代碼

復制代碼 代碼如下:
<?php
//-------------------------------------
// 文件說明:數學運算驗證碼
// 文件作者:Jesse Lee
// 最后更新:2008-09-07
//-------------------------------------

session_start();

$sessionvar = 'vdcode'; //Session變量名稱
$width = 150; //圖像寬度
$height = 20; //圖像高度

$operator = '+-*'; //運算符

$code = array();
$code[] = mt_rand(1,9);
$code[] = $operator{mt_rand(0,2)};
$code[] = mt_rand(1,9);
$code[] = $operator{mt_rand(0,2)};
$code[] = mt_rand(1,9);
$codestr = implode('',$code);
eval("/$result = ".implode('',$code).";");
$code[] = '=';

$_SESSION[$sessionvar] = $result;

$img = ImageCreate($width,$height);
ImageColorAllocate($img, mt_rand(230,250), mt_rand(230,250), mt_rand(230,250));
$color = ImageColorAllocate($img, 0, 0, 0);

$offset = 0;
foreach ($code as $char) {
$offset += 20;
$txtcolor = ImageColorAllocate($img, mt_rand(0,255), mt_rand(0,150), mt_rand(0,255));
ImageChar($img, mt_rand(3,5), $offset, mt_rand(1,5), $char, $txtcolor);
}

for ($i=0; $i<100; $i++) {
$pxcolor = ImageColorAllocate($img, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255));
ImageSetPixel($img, mt_rand(0,$width), mt_rand(0,$height), $pxcolor);
}

header('Content-type: image/png');
ImagePng($img);
?>

php技術php 數學運算驗證碼實現代碼,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 班玛县| 正定县| 伊金霍洛旗| 乐业县| 石屏县| 井陉县| 宣汉县| 宜宾市| 黄陵县| 阿克| 万全县| 福州市| 昭通市| 扬州市| 同德县| 依安县| 临邑县| 吉林市| 上林县| 修文县| 通辽市| 常山县| 名山县| 楚雄市| 长沙县| 昌平区| 广灵县| 海晏县| 宝应县| 正定县| 天等县| 彭山县| 呼玛县| 新竹市| 勐海县| 抚远县| 水富县| 调兵山市| 乌拉特中旗| 马边| 壤塘县|