You are here: Re: form validation « PHP Programming Language « IT news, forums, messages
Re: form validation

Posted by Manuel Lemos on 03/04/07 07:42

Hello,

on 02/28/2007 12:57 PM lepage.diane@gmail.com said the following:
> Hello
>
> I am a newbie to PHP. Please bear with me. I need to validate the
> following fields using php.
>
> 1. email (needs to be just one e-mail address, and take out stuff like
> bcc or anything that would be used for e-mail injection vulnerability)
> 2. Phone number (has to be in the format 555-5555)
> 3. Phone number area code (has to be limited to 3 characters)
> 4. Address has to be stripped of all illegal characters like slashes,
> special characters etc
>
> Another thing is I don't want people to be able to leave any of the
> fields blank.
>
> Where does the validation code go?
>
> After this statement?
>
> if($REQUEST_METHOD=="POST") or before?
>
> I have tried a few things, but I am not sure what most people use, any
> help would be appreciated.

Take a look at this forms generation and validation. It does all that
you ask without need to learn special Javascript:

http://www.phpclasses.org/formsgeneration

Here is a generic example in action:

http://www.meta-language.net/forms-examples.html


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация