Re: eregi problems
| From: | dan radom | Date: | Thu, 04 Jul 2002 14:46:35 +0000 |
| Subject: | Re: eregi problems | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105451@lists.php.net to get a copy of this message | ||
My main cnocern at this point is that the eregi is being totally ignored. I just want to make sure
the email address is in a valid format, not that it is a valid email address. I'll look at
validEmailFormat as well, but I don't understand why it's not even being examined.
dan
* Justin French (justin@indent.com.au) wrote:
> Dan,
>
> I'll give you a little piece of advise that was given to me a little while
> back on this list:
>
> Go to http://www.killersoft.com/ and grab a copy of the
> validateEmailFormat
> program.
>
> <QUOTE>
> PHP4 translation of Jeffrey E.F. Friedl's definitive Email Regex Program
> from O'Reilly's Mastering Regular Expressions. This function is used to
> confirm if an e-mail address adheres to the RFC 822 specification for
> internet email addresses.
> </QUOTE>
>
> Rather than trying re-invent the wheel, why not use something that conforms
> closely to specs, and is widely accepted by many development groups.
>
>
> All you'll have to do is something like (function names and filenames may
> not be right):
>
> <?
> include('inc/validEmailFormat.inc');
> if(!validEmailFormat($emp_email))
> {
> echo "<center>please enter a valid email address</center>";
> }
> ?>
>
>
> Side topic: of course, you aren't checking for a valid email address at
> all, your checking to see if the email address LOOKS valid. You're not
> checking to see if the address is attached to an email box, or furthermore
> if there's anyone at the other end to open/read your email... you're just
> validating the appearance of the address to fall within RFC 822 specs.
>
> Subsequently bill@microsoft.com and no@wayamigivingyoumyemailaddress.com
> will both return valid.
>
>
> The only way to ensure an email address is truely valid is to send an email
> to it, and have them respond... indicating that the address is linked to an
> email box and furthermore, someone opened the email, read it, and responded.
>
> Even then, this could be done by a robot I guess.
>
>
> Justin French
> --------------------
> Creative Director
> http://Indent.com.au
> --------------------
>
>
>
>
> on 05/07/02 12:23 AM, dan radom (dan@radom.org) wrote:
>
> > I've got a form that's posted to a php page where I'm attempting to
> > validate a
> > field contains a valid email address. The eregi below seems to be totally
> > ignored...
> >
> > if (eregi("^[a-z0-9\._-]+@[a-z0-9\._-]+$", $emp_email)) {
> > echo "<center>please enter a valid email address</center>";
> > exit;
> > }
> >
> >
> > $emp_email is being posted to the form. Any ideas why this is being ignored?
> >
> > dan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php