Home arrow AJAX & Prototype arrow Page 3 - Using Division Equations to Make Web Forms Safer with Ajax

Using division equations as challenge strings - AJAX

From a web developerís point of view, building a mechanism that permits you to protect online forms against attacks by spam bots, malicious automated submissions, and so forth, can be challenging. Developing such an application often requires using a server-side graphic library to generate the so-called noisy images. However, itís possible to quickly create a similar mechanism with Ajax, without having to work directly with images generated in the web server. This is the fourth part of a four-part series that explains how to do just that.

TABLE OF CONTENTS:
  1. Using Division Equations to Make Web Forms Safer with Ajax
  2. Review: challenging users with multiplication
  3. Using division equations as challenge strings
  4. Completing the Ajax-based web form protection mechanism
By: Alejandro Gervasio
Rating: starstarstarstarstar / 2
April 08, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

In order to modify the Ajax application shown in the previous segment, and make it capable of generating division equations within a specific web form, Iím going to redefine one of its source files -- specifically, the one called ďget_checkingcode.php.Ē Once modified, this file will be charged with generating the proper division equations, in this way implementing a simple protection system.

That being said, hereís the brand new definition of this PHP file. Have a look at it, please:


<?php

session_start();

$valuea=rand(1,10)*2;

$_SESSION['checkcode']=$valuea/2;

echo $valuea.' % 2';

?>


Indeed, the above file is extremely easy to follow. It simply generates challenge division equations, where the dividend will always be a random pair of integers. In this case, I decided to divide this number by 2, in order to construct simple operations, but naturally this option can be modified to fit other requirements.

So far, so good. Having modified the signature of the ďget_checkingcode.phpĒ PHP file, the Ajax program that you saw before now has the capacity to generate division equations in the form of challenge strings. Thus, provided that you've grasped how this file functions, itís time to see how it can be directly coupled to an HTML form to turn this protection mechanism into a fully-functional application.

Therefore, go ahead and read the next section. Itís only one click away.



 
 
>>> More AJAX & Prototype Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

AJAX & PROTOTYPE ARTICLES

- Best AJAX Tutorials for Forms
- The Best AJAX Tutorials
- 8 Great Ajax Tutorials
- Using Ajax and jQuery
- Using Ajax and jQuery with HTML Forms
- Ajax.org Offers Cloud9 IDE for JavaScript
- Java Technologies Provider ICEsoft Releases ...
- Using Recaptcha in AJAX Prototype Framework ...
- Google's Closure Compiler Service API: Addit...
- Installing Google Web Toolkit: Introducing t...
- Google's Closure Compiler Service API: Displ...
- Google's Closure Compiler Service API: Deliv...
- Google's Closure Compiler Service API: the A...
- Google's Closure Compiler Service API: the S...
- Google's Closure Compiler Service API: Optim...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: