最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一个简单php验证码程序代码
时间:2022-06-24 15:54:18 编辑:袖梨 来源:一聚教程网
验证码识别一般分为以下几个步骤:
1. 取出字模
2. 二值化
3. 计算特征
4. 对照样本
代码如下 | 复制代码 |
$_img = imagecreatetruecolor($_width, $_height); $_white = imagecolorallocate($_img, 250, 250, 250); imagefill($_img, 0, 0, $_white); $_gray = imagecolorallocate($_img, 196, 196, 196); imagerectangle($_img, 0, 0, $_width-1, $_height-1, $_gray); for ($i=0; $i
$_md_color = imagecolorallocate($_img, mt_rand(200,255), mt_rand(200,255), mt_rand(200,255)); for ($i=0; $i
$_md_color = imagecolorallocate($_img, mt_rand(200,255), mt_rand(200,255), mt_rand(200,255)); for ($i=0; $i
$_md_color = imagecolorallocate($_img, mt_rand(0,102), mt_rand(0,102), mt_rand(0,102)); header("Content-Type:image/png"); imagepng($_img); imagedestroy($_img); |
验证码使用方法
代码如下 | 复制代码 |
$getcode = $_POST['code']; if( $_SESSION["code"] = $getcode ) |
相关文章
- 绝区零卢西娅音擎怎么选-卢西娅音擎选择推荐 10-21
- 消逝的光芒困兽锈蚀剑图纸怎么获得 锈蚀剑图纸获取方法 10-21
- 荣耀冒险王兑换码大全 荣耀冒险王2025最新兑换码分享 10-21
- 奔奔王国兑换码大全 奔奔王国2025最新兑换码一览 10-21
- 梦幻消除战兑换码大全 梦幻消除战2025最新兑换码一览 10-21
- 星塔旅人秘纹怎么选 秘纹推荐攻略 10-21