Re: Form Validation filter - Regex Q

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

on 11/10/2009 03:34 PM Haig Davis said the following:
> I've been figthing with this little problem for two days now, so far no luck
> with google and am beginning to question my own sanity.
> 
> I have a application that has over one hundred forms some quite lengthy so
> what I'm trying to achieve rather than writing a bunch of individual
> sanitize statements then form validation statemenst that I could run $_POST
> through a foreach loop and filter the values by form class i.e.is it an
> emaill addreess or simply a text block with letters and numbers. The regex's
> alone work fine as does the foreach loop the only issue I have is the IF
> statement comparing $key to expected varieable names.

I am not a big fan of filtering. If the form has invalid data, do not
accept it, just show the form again to the user and make it fix it. He
may have made a mistake and if you fix his mistakes, you may be doing it
incorrectly.

What I suggest is to present the form again to the user denoting invalid
fields.

You may want to watch this tutorial video on this subject:

http://www.phpclasses.org/browse/video/1/package/1/section/usage.html

Other than that, doing all validation by hand is painful. You may want
to try this forms generation and validation package that performs all
the necessary types of validation on the server side in PHP and on
browser side using Javascript generated by the class within your form
template.

http://www.phpclasses.org/formsgeneration

Take a look here for a live example:

http://www.meta-language.net/forms-examples.html?example=test_form

If you have many forms for CRUD (Create, Retrieve, Update and Delete)
operations, you may want to also use this plug-in that automates the
generation of tha types of forms so you can do it in a fraction of your
time.

http://www.meta-language.net/forms-examples.html?example=test_scaffolding_input


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux