Re: [Phplib-users] New phpauth code
Brought to you by:
nhruby,
richardarcher
|
From: Michael C. <mdc...@mi...> - 2002-05-06 21:14:37
|
On Mon, May 06, 2002 at 04:08:38PM -0500, Layne Weathers wrote:
> > > I try to register in your site, but get response that my
> > email is invalid.
> > > Althought my email is valid for years (not this but other).
> >
> > The email address is checked against a simple regular expression.
> > preg_match('/^([a-z0-9\-_\.\&]+)@([a-z0-9\-]+\.)+[a-z]+$/',$email);
> > I assume you're mixing case (email addresses and domain names are case
> > insensitive).
>
> If email addresses are case insensitive, why do you force your (lower) case
> preference? Using uppercase letters is quite valid and often makes email
> addresses more human-readable.
I generally force the username to lowercase before doing the check, and
this code should do that (it's not rocket science to implement it).
I'll probably make that change.
I won't allow case-sensitive matching. I've done it before, and
inevitably someone ends up typing in a couple of caps in their email
address, then they can't understand why it won't work next time when
they don't. Same with passwords, sad to say.
> In addition to checking email addresses against a simple format, I check
> against all known TLDs. I also find it useful to warn users if I cannot find
> an MX record for their domain. This prevents numerous "us...@ho..."
> attempts.
That's not a bad idea. Have any code which you'd like to share?
Michael
--
Michael Darrin Chaney
mdc...@mi...
http://www.michaelchaney.com/
|