Home arrow PHP arrow 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.

TABLE OF CONTENTS:
  1. Validating Web Forms with the Code Igniter PHP Framework
  2. Validating user-supplied data using the MVC pattern
  3. Displaying error messages when validating an online form
  4. Building a confirmation view file
By: Alejandro Gervasio
Rating: starstarstarstarstar / 18
September 03, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

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!



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap

Dev Shed Tutorial Topics: