RE: [PHP-DB] E-mail address verification
| From: | Jeff Field | Date: | Thu, 20 Jun 2002 13:41:07 +0000 |
| Subject: | RE: [PHP-DB] E-mail address verification | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19900@lists.php.net to get a copy of this message | ||
Perhaps this will get you started. BTW, there are various levels of email
address validation you can do depending on how deep you want to get. This
one should take care of the problems you mention.
function CheckEmail($email)
{
if (!eregi("^([a-z0-9!#\$%^&*+=?/._-])+@([a-z0-9]+[a-z0-9.-]*[a-z0-9]+$)",
$email))
{
$valid_email = FALSE; // or whatever action you want to take here
}
else
{
$valid_email = TRUE; // or whatever action you want to take here
}
return $valid_email;
}
Jeff
> -----Original Message-----
> From: Gary.Every@ingramentertainment.com
> [mailto:Gary.Every@ingramentertainment.com]
> Sent: Thursday, June 20, 2002 8:14 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] E-mail address verification
>
>
> I'm looking for a good function that will allow me to verify that a valid
> e-mail address has been entered.
> I'm working with sales people that seem to get every possible problem
> entered into the field, such as:
>
> bill@here (no .com)
> bill@here .com (space, makes two email addresses!)
> bill@here,com (comma)
> bill
> bill@
> and the list goes on.
>
> Any input would be appreciated.
>
>
> Gary Every
> "Pay It Forward"
> mailto:gary.every@ingramentertainment.com
> http://accessingram.com
>