NYCPHP Meetup

NYPHP.org

[nycphp-talk] Sneaking in unwanted characters

Jeff jsiegel1 at optonline.net
Wed Sep 10 18:11:39 EDT 2003


Well...as noted in the "Validate Email" section of this page -
http://www.phphelp.com/start - 
"The most comprehensive regular expression currently available for
testing if an email address is valid was published in Mastering Regular
Expressions from O'Reilly Publishing. It appears on page 316 and weighs
in at more than six thousand characters...."

I'm sure there's a better way.

Jeff

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of tom at supertom.com
Sent: Wednesday, September 10, 2003 3:32 PM
To: NYPHP Talk
Subject: RE: [nycphp-talk] Sneaking in unwanted characters


Although it is true that it is "technically" a valid address, in
reality, it
is an incorrect one.  I see this all the time, in data that I receive
from
my clients, and even in printed material from companies.  And I can't
tell
you how many times these addresses have bounced back (I too was once
from
the school of "try it, may it REALLY IS their address").  Something
needs to
be done to ensure that the customers type in valid email addresses, and
this
is what this fellow's client came up with.  As we have all noticed, it
is
not fool-proof.

Perhaps I would suggest a 2nd textbox to confirm that the user typed the
address in correctly, and perhaps even a confirmation link in an email
to
that address, to prove a customer actually receives email at that
address.
But, I suspect that this doesn't happen often enough to justify those
programming changes, so I would just go with removing the beginning
'www.'
as well.  Or, perhaps some other scrubbing mechanism somewhere else in
the
chain (perhaps when the email addresses are exported, etc.).  The
solution
has to fit the problem, and I would be very interested to see the "big
contract" that is sent from the address
"www.someexecutive at bigcompany.com".

Good Luck!

Tom





***************************************************
What's Tom listening to right now?  Find out here:
http://www.supertom.com/current_track.php




-----Original Message-----
From: talk-bounces at lists.nyphp.org
[mailto:talk-bounces at lists.nyphp.org]On Behalf Of Chris Shiflett
Sent: Wednesday, September 10, 2003 4:19 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Sneaking in unwanted characters


--- Jeff <jsiegel1 at optonline.net> wrote:
> My client doesn't want anyone who visits his website to enter an email
> address like www.me at mydomain.com.

Others have mentioned this, but that is a perfectly valid email address.
Maybe
instead of spending time writing a regex to exclude some special case,
you
should take the time to make sure your client understands what an email
address
is. Is there a valid reason to exclude some email addresses and not
others?
Why? Don't hesitate to question a client.

As a consultant, I would consider it my responsibility to do so.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk

_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list