Home >Backend Development >PHP Tutorial >PHP verification code tool - Securimage_PHP tutorial
In my recent project, I came across a new PHP verification code tool - Securimage. It is very simple and convenient to use and supports ajax calls, so I recommend it to everyone here. What is Securimage? Securimage is an open source/free phpCAPTCHA script, which can be used to generate complex verification code images to help your website prevent spam. It can be easily embedded into existing forms on your website, providing your website with protection from spam bots. It can run on most webservers that support PHP (GD). *Click here to view the quick guide Features of Securimage: * Display the verification code with only three lines of code Here’s a simple example for you:
*Securimage Example
*Download the latest version
* Verify the input of the verification code with only six lines of code
* Customize the verification code length
* Customize the character set
* Support TTF
* Use custom GD fonts (if not supported by TTF)
* Easily add custom background images
* Rich text support, including color/angle/transparency options
* Text obfuscated Arched lines through text
* Generate CAPTCHA audio file in wav format
* Customize CAPTCHA verification code list
if (empty($_POST)){?>
} else{//form is posted
include("securimage.php");
$img=new Securimage();
$valid=$img->check($_POST[code]);//Check whether the user’s input is correct
if($valid==true) {
echo "
} else{
echo "< center>Sorry, the code you entered was invalid. Go back to try again.";
}
}
?>
securimage_show.php code:
include securimage.php;//Download the core library code in the package
$img=new securimage();
$img->show();// alternate use: $img->show(/path/to/background.jpg);
?>