HomePHP Validating Web Forms with the Code Igniter PHP Framework
Validating Web Forms with the Code Igniter PHP Framework
If you're a web developer, you've probably written any number of scripts designed to validate the input entered into a web form. More than likely, then, you'd like something that will make that job easier. Enter the Code Igniter PHP framework. In this fourth part of a nine-part series on this framework, you'll learn how to use it to do basic validation on a web form.
As you know, not all the PHP frameworks available nowadays on the web have been created in the same way. This is particularly relevant when you need to choose one of them with which to start developing several web applications.
For example, Zend is a solid piece of software, best suited to building enterprise-level PHP programs. This means that some of its features can be pretty overwhelming for developers taking their first steps into the huge terrain of object-object programming.
However, among the numerous PHP frameworks that present a friendly learning curve, thereís one that stands from the rest, not only for its remarkable capabilities for developing complex applications in a short time, but for its minimal setup requirements.
Of course, as you might have guessed, Iím talking about Code Igniter (http://codeigniter.com), a software package created with PHP 4 that allows you to build database-driven PHP programs within minutes! No, really.
In the previous tutorial of this series, I demonstrated how to use this framework to develop a simple MySQL-driven application. It was tasked with pulling a few database records from a simple table to be displayed later on the browser.
In addition, itís worth mentioning that the application in question had the capacity for paging these records across several web documents, thanks to the assistance of the pagination class that comes bundled with Code Igniter.
Now that I have quickly summarized the topics that were discussed in the last tutorial, itís time to continue exploring the many other useful features offered by Code Igniter. Therefore, in the course of the next few lines, Iím going to show you how to use the validation class included with this framework to develop a PHP program that can be used to check data submitted through some web forms.
Once again, youíll have opportunity to see for yourself how easy it is to validate online forms with Code Igniter. Letís get started!