News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

The Tutorial Blog:
Adding security to CodeIgniter forms with a custom library class
December 17, 2009 @ 08:15:41

On The Tutorial Blog today they've shared a library that you can use on your CodeIgniter application to help give your forms a bit more security - a math problem "captcha".

The class that we are going to create within CI will simply add a math question that the user will have to enter correctly to continue. This is useful to stop bots from mass submitting information to your forms. The class we are going to write is only very short and simple, but it will give you an idea of how to create classes for your own projects.

Their class creates two random numbers to be used for the question, displays the question the user should answer (Ex. "What is 2 + 4?") and sets the answer in the flashdata, ready for the page submit. When the controller reloads, the answer the user gave and the one from the flash are compared as a part of the standard form validation rules.

0 comments voice your opinion now!
codeigniter framework tutorial captcha addition


blog comments powered by Disqus

Similar Posts

Klaus Graefensteiner's Blog: Getting Wordpress installed in a jiffy on Windows 7 using the WPI

WebReference.com: Build Your Own PHP Web Mailer

Zend Developer Zone: Enhance performance with Zend_Cache

Phil Sturgeon's Blog: UTF-8 support for CodeIgniter

Christoph Hochstrasser: PHP Socket Programming, done the Right Way (tm)


Community Events





Don't see your event here?
Let us know!


interview install configure list series introduction library application developer podcast release language wordpress laravel unittest community code threedevsandamaybe bugfix api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework