PHP
  Home arrow PHP arrow Developing a Form Validation System wi...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
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

Developing a Form Validation System with the Observer Pattern in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 7
    2006-07-24

    Table of Contents:
  • Developing a Form Validation System with the Observer Pattern in PHP
  • Validating input data: constructing some useful data validation classes
  • Extending the scope of data validation: defining some additional data checking classes
  • Getting the whole picture: listing the full source code for the data checking classes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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


    Developing a Form Validation System with the Observer Pattern in PHP


    (Page 1 of 4 )

    Want to gain a good grounding in how to apply the Observer pattern in PHP? Then you’re in the right place! Welcome to the second part of the series “The Observer Pattern in PHP.” Composed of three tutorials, this series teaches you the key concepts of the popular Observer design pattern, and shows you how to apply it in the context of real-world PHP applications.

    Introduction

    Okay, after introducing the topics treated over the course of this series, let’s quickly recapitulate the concepts that I deployed in the first tutorial so you can understand this second article more easily.

    As you’ll hopefully remember, in the previous part I went through the implementation of the Observer pattern in PHP 5 by coding a basic example. The example demonstrated in an easygoing fashion how the different objects that make up a specific program can be decoupled from the rest of the application, in this way clearly delineating their scope.

    Regarding this particular example, the implementation of the Observer pattern allowed me to develop a message handling system capable of reflecting certain changes generated by independent objects at the application’s core level. Indeed, the application of this pattern is one of the best approaches available today for constructing truly independent objects, as well as building systems that expose a centralized mechanism for making decisions according to the changes introduced by disparate components.

    Well, after refreshing some of the most important points regarding the creation of observer objects, let’s focus our attention on the subject of this second tutorial. Over the next few lines, I’ll be demonstrating how to apply the Observer pattern during the development of a real-world application: a form validation system.

    Based on this approach, hopefully you’ll learn quickly how to validate input data by using the Observer pattern. Are you interested in learning how this can be achieved with PHP? Fine, start right now reading the next section!

    More PHP Articles
    More By Alejandro Gervasio


       · This second article of the series is aimed at demostrating how an observer object...
     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway