Posted by axlq on 09/11/07 02:10
I'm trying to figure out a MySQL query expression to match an email
address. Here's the situation:
User registers on my site with a "plus style" email address
(username+key@example.com). This is a perfectly legal address and I
don't want to disallow it, because I use this style myself and find
it useful. For example user+whatever@gmail.com will get delivered
to user@gmail.com.
Now, the user forgets his password. He is prompted to enter his
email address, to which my site will send a temporary password.
Problem: if he enters username@example.com instead of the address
username+key@example.com that's stored in my database, I should be
able to find the address. How do I construct a MySQL query to match
what the user enters with the "plus" address in the database?
The simplest way is to strip the +suffix from the username when the user
first registers on my site, but I'd rather not do that.
-A
[Back to original message]
|