Re: [PHP] email validation string.
- From: nick@xxxxxxxxxxxxxx (Nick Stinemates)
- Date: Thu, 18 Jan 2007 06:07:24 -0800
I just got this from: http://php.net/preg_match
<?php
if(eregi ("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,6}$", stripslashes(trim($someVar))))
{
echo "good";
}
else
{
echo "bad";
}
?>
Hope it works out for you.
- Nick Stinemates
On Thu, Jan 18, 2007 at 01:40:36PM -0700, Don wrote:
I'm trying to get this line to validate an email address from a form and it.
isn't working.
if (ereg("^.+@.+\..+$",$submittedEmail))
The book I'm referencing has this line
if (ereg("^.+@.+\\..+$",$submittedEmail))
Anyway.. I welcome any advice as long as it doesn't morph into a political
debate on ADA standards and poverty in Africa. :-)
Thanks
Don
- Follow-Ups:
- Re: [PHP] email validation string.
- From: tedd
- Re: [PHP] email validation string.
- From: Roman Neuhauser
- Re: [PHP] email validation string.
- References:
- email validation string.
- From: "Don"
- email validation string.
- Prev by Date: Re: How to prevent DomDocument from adding a !DOCTYPE.
- Next by Date: Re: What makes a PHP expert
- Previous by thread: email validation string.
- Next by thread: Re: [PHP] email validation string.
- Index(es):
Relevant Pages
|