Re: reg expression for ide-emails
| From: | csko | Date: | Mon, 29 Mar 2004 14:29:39 +0000 |
| Subject: | Re: reg expression for ide-emails | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-181660@lists.php.net to get a copy of this message | ||
> If you're going to validate a user@domain.crap.foo.bar address, why even
> bother? Seriously. There are a 1000 different regular expressions for email
> addresses out there and each of them have flaws to some extent.
>
> If your application is so important that it requires a valid email address,
> you should send them something to confirm it. Otherwise, just take whatever
> crap they give... if they don't want emails, so be it.
>
> ---John Holmes...
Hi!
I think it's good to have a preg_match(), ereg(), or some other check.
I also check badwords in emails entered by a form:
if(!eregi("((root)|(admin)|(webmaster)|(postmaster)|(csko)|(r00t)|(r0ot)|(ro0t)|(kernel)|(system)|(sysadmin)|(csko)|(administrator)|(rendszergazda)|(operator))",$email)){
}
Why? Becasuse some people entered root@localhost as email :)
csko
csko@csko.lame.hu