PHP Verification Code Tool-securimage_php Tutorial

Source: Internet
Author: User

Recent projects have come into contact with a new PHP captcha tool-securimage, which is very simple and convenient to use, and supports Ajax calls, so here's a recommendation for you.

What is Securimage?

Securimage is an open source/free Phpcaptcha script that can be used to generate complex CAPTCHA images to help your site prevent spam. It can be easily embedded in the existing forms of the site, providing your site with the protection of spam robots. It can run on most webserver that support PHP (GD).

* Click here to view the Quick guide
*securimage instances
* Download the latest version

Features of the Securimage:

* Display verification code in only three lines of code
* Validate code input with only six lines of code
* Custom Verification code length
* Custom Character Set
* Support TTF
* Use a custom GD font (if TTF is not supported)
* Easily add a custom background image
* Rich text support, including color/angle/Transparency options
* Text confusions arched lines through text
* Generate CAPTCHA audio files in WAV format
* Custom CAPTCHA Verification Code list

Let's give you a simple example:



Securimage Test Form


if (empty ($_post)) {?>


} Else{//form is posted
Include ("securimage.php");
$img =new securimage ();
$valid = $img->check ($_post[code]);//Check that the user's input is correct

if ($valid ==true) {
echo "

Thanks, you entered the correct code. ";
} else{
echo " Sorry, the code you entered is invalid. Go back to try again. ";
}
}

?>



Securimage_show.php's Code:

Include securimage.php;//the core class library code inside the download package
$img =new securimage ();
$img->show ();//alternate use: $img->show (/path/to/background.jpg);
?>

http://www.bkjia.com/PHPjc/486571.html www.bkjia.com true http://www.bkjia.com/PHPjc/486571.html techarticle recent projects have come into contact with a new PHP captcha tool-securimage, which is very simple and convenient to use, and supports Ajax calls, so here's a recommendation for you. What is ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.