RE: [PHP] I lied, another question / problem
| From: | Beauford | Date: | Mon, 15 Jan 2007 23:33:31 +0000 |
| Subject: | RE: [PHP] I lied, another question / problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247123@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Roman Neuhauser [mailto:neuhauser@sigpipe.cz]
> Sent: January 15, 2007 7:09 PM
> To: Beauford
> Cc: PHP
> Subject: Re: [PHP] I lied, another question / problem
>
> # phpuser@netscan.ca / 2007-01-15 16:31:32 -0500:
> > I have file which I use for validating which includes the following
> > function:
> >
> > function invalidchar($strvalue)
> > {
> > if(!ereg("^[[:alpha:][:space:]\'-.]*$", $strvalue)) {
>
> That regexp matches if $strvalue consists of zero or more
> ocurrences of a letter, a whitespace character, and any
> character whose numeric value lies between the numeric values
> of "'" and "." in your locale.
> Zero or more means it also matches an empty string.
>
I'm still confused. This works perfectly on my other two pages with the
exact same code. So why is it only this one page that is causing a problem?
If I enter the word "test" in my form, without the quotes, then why is the
fuction returning anything since this is a valid entry. Should it not only
return a value if there is a problem.
All I want to accomplish here is to allow the user to enter a to z, A to Z,
and /\'-_. and a space. Is there a better way to do this?
Thanks