October 2, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Create a CAPTCHA Script with PHP

  • January 5, 2010
  • By Octavia Anghel
  • Send Email »
  • More Articles »

CAPTCHA is a very simple and common protection that helps prevent spam and the automatic submission of an operation by some kind of program or robot. CAPTCHA protection is used on web site forms and works by generating a random string, writing it to an image, then storing the string inside of a session. Then, the site checks the CAPTCHA when the form is submitted. In her PHPBuilder.com article, Octavia Andreea Anghel provides step-by-step instructions for making your own simple CAPTCHA image using PHP.

The core of the demo application is a PHP class capable of generating random text and an image that will contain the text (the class is encapsulated in the GeneratedCaptcha.php script). This image will be your CAPTCHA. At a high level, to create your CAPTCHA image you take the following steps:

  1. Generate random text.
  2. Generate the image containing the random text.

Read the entire article to learn how to create a CAPTCHA script with PHP.


Tags: open source, PHP, Web site, spam, CAPTCHA




Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel