Using Simple Checksums for Web Form Verification with Ajax
As you know, Ajax is a technology that can be used to perform all sorts of clever tasks; this includes building web forms that are less vulnerable to attacks from malicious web bots. Indeed, it’s pretty simple to develop certain mechanisms that permit the dynamic generation of verification codes via Ajax, which must be entered manually by a user before submitting an HTML form. This is the second part of a four-part series that shows you how to make your web forms safer with Ajax.
Actually, building a web form checking system like this can be an instructive experience, particularly for those web developers whom need to code safer online forms without using a server-side graphic library to generate "noisy images" on the fly.
So, if you're interested in learning how to use Ajax to construct more secure web forms, then you should take a look at this series of articles. It will provide you with an approachable guide to utilizing Ajax to create different types of verification codes, which can be incorporated into any existing HTML form with minor hassles.
Returning to the subject discussed in the previous article, you'll recall that I used a hands-on approach to explain how to use the functionality of Ajax to build a simple code verification system. This system could be attached to any web form to protect it against automated submissions.
This basic Ajax application was capable of generating different random strings each time a user proceeded to submit a sample online form. This same concept can be easily extended, however, for creating different types of verification codes, not just randomized values.
Keeping this idea in mind, in the next few lines I'm going to explain how to build an Ajax-based program which will be able to display, in a predefined area within a web form, a simple mathematical sum instead of a the typical random string. Logically, users will have to enter the correct result of this operation before submitting the online form, in this way implementing an alternative security method.
Developing this Ajax application will be an educational and fun experience, so let's get rid of the preliminaries and get started!