To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Code Critique

Code Critique Having someone critique your code is always a great way to hone the skills. Stop in and post your code to see what your peers may have done differently.

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-04-2004, 02:11 PM   #1
tbach2
Senior Member
 
tbach2's Avatar
 
Join Date: Jun 2003
Posts: 235
Input validation object

This is a partial PHP port of the CPAN Data::formValidator module. It has only a few of the options, but I figure its a good start.

The setup in your pages may seem a bit cumbersome at first, but I think you'll find that the way it lets you define constraints and dependencies makes it worth it.

The current setup lets you define
  • required variables
  • optional variables
  • variable dependencies
  • filters for the variables
  • constraints for the variables
The object makes available a list of
  • missing variables (required and dependencies)
  • invalid variables (failed their constraint)
  • filtered variables
  • valid variables
I'm looking for critique/ suggestions on
  • design and readability
  • code efficiency
  • code usefulness
  • any suggestions how to validate arrays in addition to scalar vars
Thanks
Attached Files
File Type: txt validate_class.php.txt (16.2 KB, 127 views)
tbach2 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:27 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.