search
Homephp教程php手册PHP验证码工具-Securimage

最近项目中接触到了一个新的php验证码工具 -Securimage,使用起来非常简单和方便,并且支持ajax调用,因此在这里给大家推荐一下。

什么是Securimage?

Securimage是一个开源/免费的phpCAPTCHA脚本,它可以用来生成复杂的验证码图片,帮助您的网站防止spam。它可以轻松嵌入网站已存的表单中,为您的网站提供spam机器人的防护。它可以运行于大部分支持php(GD)的webserver上。

*点击这里查看快速指南
*Securimage实例
*下载最新版本

Securimage的特性:

* 仅用三行代码即可显示验证码
* 仅用六行代码即可对验证码的输入进行验证
* 自定义验证码长度
* 自定义字符集
* 支持TTF
* 使用自定义的GD字体(若TTF不支持)
* 轻松添加自定义背景图片
* 丰富的文本支持,包括颜色/角度/透明度选项
* 文字淆乱Arched lines through text
* 生成wav格式的CAPTCHA音频文件
* 自定义CAPTCHA的验证码列表

下面给大家一个简单的例子:



  Securimage Test Form


if (empty($_POST)){?>

Username:



Password:



 

PHP验证码工具-Securimage





 
} else{//form is posted
 include("securimage.php");
 $img=new Securimage();
 $valid=$img->check($_POST[code]);//检查用户的输入是否正确
 
 if($valid==true) {
   echo "
Thanks, you entered the correct code.
";
 } else{
   echo "
Sorry, the code you entered was invalid.  Go back to try again.
";
 }
}
 
?>
 


securimage_show.php的代码:

include securimage.php;//下载包里面的核心类库代码
$img=new securimage();
$img->show();// alternate use:  $img->show(/path/to/background.jpg);
?>

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool