PHP
  Home arrow PHP arrow Performing Strict Validation with the Code Igniter PHP Framework
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Performing Strict Validation with the Code Igniter PHP Framework
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 3
    2008-09-10


    Table of Contents:
  • Performing Strict Validation with the Code Igniter PHP Framework
  • Performing strict validation on user-provided data with Code Igniter
  • Repopulating a web form with Code Igniter
  • Completing the form validation application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Performing Strict Validation with the Code Igniter PHP Framework
    ( Page 1 of 4 )

    Welcome to the fifth article in our nine-part series on the Code Igniter framework. In the last article you learned a very simple way to use the framework to check information supplied by users through an HTML form. The type of checking done was very simple, however, and user-supplied data must be checked and validated pretty strictly for many purposes. This article will show you how to improve the previous application's validation mechanism.

    Introduction

    Code reusability is a well-known and powerful concept that provides PHP programmers with the capacity for developing complex web applications without having to “reinvent the wheel.” Naturally, in the area dominated by third-party frameworks this concept is really king, since the main goal of a development framework is to accelerate the creation of PHP programs through a set of classes and functions that can be reused any number of times.

    Of course, when it comes to picking a particular PHP framework for rapid application development, there’s plenty of options available, and naturally each of them has its own pros and cons. However, before you start scratching your head over which package to choose, you should take a look at Code Igniter (http://codeigniter.com), a piece a software written in PHP 4 that lets you build full-blown PHP applications by using the Model-View-Controller pattern, and best of all, by means of a friendly programming interface.

    And speaking of friendly things, you’ll possibly recall that in the previous installment of the series, I explained how to use Code Igniter’s validation class to perform a basic checking process on a simple web form. Essentially, the entire validation procedure was reduced to creating a controller class capable of verifying if each field of the form in question was left empty or not. That’s all.

    In addition, based on the result of this process, the controller would either display a simple confirmation web page, or in the worst case, it would redisplay the sample web form, along with an error message indicating which fields should be populated correctly.

    But, as I mentioned before, the checking process performed on this online form was pretty simplistic. In this fifth chapter of the series, I’m going to demonstrate how to use Code Igniter’s validation class to validate the data collected through a typical HTML form much more strictly, something that can be very useful for filtering user-supplied information.

    Now, it’s time to jump forward and learn in a few easy steps how to perform strict validation on input data with Code Igniter. Let’s get started!



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

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT