News Feed
Sections




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

PHPBuilder.com:
PHP Form Validation System An Object-Oriented Approach
April 21, 2008 @ 08:49:24

Mike Weiner has put together an article for PHPBuilder.com that's posted today showing a bit more object-oriented solution to validating the user submitted data in your forms:

Whether it is for database submission, emailing, or for some other purpose, forms represent the primary means of enabling a user to send data to an application. As a result, it is important to have control over the data collected by your forms, which will aid in the creation of streamlined, error-free applications.

He lays out the validation method in a graphic going with a generic validation class that then calls the various validation methods (like phone or email) as needed. The "validation set" manages which validations are to be run on which form elements. Example code for each of the bits making up the structure and the implementation are provided.

1 comment voice your opinion now!
object oriented approach form validation tutorial


blog comments powered by Disqus

Similar Posts

Artur Ejsmont's Blog: How to build mongodb pecl extension in 32bit for PHP 5.2 on OSX Snow Leaopard

Amazon Web Services PHP Blog: Provision an Amazon EC2 Instance with PHP

SitePoint PHP Blog: Ardent: Laravel Models on Steroids

Stefan Mischook's Blog: Building Objects Video (Parts 1, 2 & 3)

DevShed: Developing a Form Director Class


Community Events

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


introduction framework api configure series performance install library language example php7 opinion conference application release podcast laravel community symfony2 interview

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