Re: regular exp if help
| From: | Chris Murley | Date: | Wed, 23 Aug 2000 21:38:28 +0000 |
| Subject: | Re: regular exp if help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13232@lists.php.net to get a copy of this message | ||
Dooh, still not working, this gives me a syntax error, and i cant seem to
see why
if (!ereg("^[[:alnum:]]+$", $Username)) {
exit;
}
On Wed, 23 Aug 2000, Andreas Pour wrote:
> Chris Murley wrote:
> >
> > Hi All
> >
> > i tried this code:
> >
> > if ( !ereg( "([a-zA-Z0-9])" , $Username) ){
> > exit;
> > }
> >
> > it works when i set $Username="'" but if i use
> > $Username="i'm cool"
> >
> > it says thats ok
> >
> > Any ideas?
>
> yeah, you're just requiring one alnum in the subject. You need
>
> ereg("^[[:alnum:]]+$", $username)
>
> Ciao,
>
> Andreas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>