Re: VERY IMPORTANT question about validation using php

Re: VERY IMPORTANT question about validation using php

am 04.04.2008 19:04:09 von good

In article , timr@probo.com
says...
> Sudhakar wrote:
> >
> >i am using php in order to validate a form where users register.
> >please help me to solve the following validations.
> >
> >1. name can have spaces. ex= john smith
> >presently the validation i am using is if( $fname == "" || !
> >eregi("^[a-zA-Z_]+$", $fname) )
> >i need the syntax which would accept a-zA-Z WITH A SPACE IN BETWEEN
> >NAMES ex= john smith
>
> Could you really not figure out how to add "space" to the list of legal
> characters in that?

Its easy to forget many people building web sites are not trained
programmers.... anyway...

sigh... For all those that cant do/dont like/dont want/ ... regex's
or complex PHP

www.streamforensics.com - automated forms validation - look for the
pforms program - what you want is a simple look up in their function list
described in simple english. There is even a free trial version you can
use live safely.

It even writes all the PHP validation code for you.

Re: VERY IMPORTANT question about validation using php

am 05.04.2008 16:13:32 von sheldonlg

good@respnse.sic.com wrote:
> In article , timr@probo.com
> says...
>> Sudhakar wrote:
>>> i am using php in order to validate a form where users register.
>>> please help me to solve the following validations.
>>>
>>> 1. name can have spaces. ex= john smith
>>> presently the validation i am using is if( $fname == "" || !
>>> eregi("^[a-zA-Z_]+$", $fname) )
>>> i need the syntax which would accept a-zA-Z WITH A SPACE IN BETWEEN
>>> NAMES ex= john smith

$no_leading_or_trailing_spaces = trim($fname);