PHPEveryday.com PHP and Web Development Tutorial
What are you looking for?


PHP Error Message

Warning: Invalid argument supplied for foreach() in /home/a3178292/public_html/article.php on line 213

Free Web Hosting

CAPTCHA - part 1 : "Are you human or ....?" (Introduction)


PHP CAPTCHA Tutorial: Nowdays, forms in many sites have a image that we must rewrite its content to a textbox for validation. Its content can be a sequence of numeric, alphabet, or mixed (that we called alphanumeric). For example, you will find it at yahoo register form, google register form, blog creation form, and many sites. Security reason.

Why we must use this item for security?

Look at this simple form:
<Form method='get' action='logon.php'>
Put your name please <Input type='text' name='name'><br>
<Input type='submit' name='submit' value='submit'>
</Form>

This form will collect information from user. This information will be stored at table in database. When somebody submit this form, you can see this url in address bar:

http://mysite.com/logon.php?name=Wiwit+Siswoutomo

Now, what a weakness about this way?

Imagine, there is somebody write this code:

<?
for($i=0;$i<=1000;$i++){
$lines = file('http://www.mysite.com/logon.php?name=Just+Kidding');
}
?>

And then he upload in anything server. Execute that code. Without open legal form, he can fulfill that information. Not only one information, a thousand. How about he rewrite become:

<?
for($i=0;$i<=1000000;$i++){

}
?>
only in several mili seconds, he can store a milion data!


Series this article:
CAPTCHA - part 1 : "Are you human or ....?" (Introduction)
CAPTCHA - part 2: "Are you human or ....?"
CAPTCHA - part 3 : "Are you human or ....?" (Build Your CAPTCHA)
CAPTCHA - part 4 : "Are you human or ....?" (Modify Your CAPTCHA)


Tag: captcha, php security, php class Category: PHP Security, PHP Classes Post : October 05th 2007 Read: 2,366 Bookmark and Share

blog comments powered by Disqus


Database Tutorial
  • Learn PHP MySQL
  • Learn PHP ADOdb
  • Learn PHP Data Object/PDO
  • Learn PHP XML
  • Learn PHP SimpleXML
Security Tutorial
  • Learn PHP Security
  • Learn HTTP Authentication
  • Learn PHPSecureSite
Framework Tutorial
  • Learn CodeIgniter
  • Learn Joomla
  • Learn Smarty
  • Learn Zend Framework
Template Tutorial
  • Learn Joomla Template
  • Learn WordPress Template
API Tutorial
  • Learn Facebook
JS Framework Tutorial
  • Learn MooTools
  • Learn JQuery
AJAX Tutorial
  • Learn AJAX in 10 Minutes
  • Learn AJAX Client Side
  • Learn AJAX PHP
  • Learn AJAX Remote Server
  • Learn AJAX Repetitive
  • Learn AJAX MySQL
  • Learn AJAX Grid
Web Services Tutorial
  • Learn Web Services NuSOAP
  • Learn Web Services WSDL
  • Learn Web Services WSDL Array
  • Learn Web Services .NET Grid
  • Learn Web Services WDDX
Package Post
  • Joomla Intro
  • Joomla Component
  • Joomla Module
  • Joomla MVC
  • Joomla MVC Backend
  • PostNuke Intro
  • Zend Framework Intro
  • Zend Framework Action
  • Zend Framework Database
  • Zend Framework Registry
  • Zend Framework Config
  • Zend Framework Login
  • Zend Framework Session
  • PHP Array Tips
  • PHP File Tips
  • PHP Email
  • PHP Ms Excel
  • PHP Pattern
  • PHP SMS
  • Flash Database
  • PHP Multitier
  • jQuery Introduction
  • jQuery Selectors
  • Portable Web Server
  • Web Mobile Intro
  • Drupal Installation
  • Drupal Configuration