shawn wilson wrote:
On Mar 7, 2011 11:37 AM, "Brandon McCaig" <bamcc...@gmail.com>
wrote:
>
> On Mon, Mar 7, 2011 at 5:22 AM, Ramprasad Prasad
> <ramprasad...@gmail.com>
wrote:
>> 1) Create a hash of aliases for frequently used domains and their
>> typos For eg gmaill.com => gmail.com hotmal.com => hotmail.com
>> etc
>>
>> when I get the email id with these typos , I will prompt the
>> user for correction , If accepted then thats fine
>
> It's difficult to predict every possible typo that a user is going
> to make. They could have their hands off-by-one and type something
> completely different. Perhaps you could instead just store a list
> of common mail domains and warn the user to double-check if their
> E-mail address doesn't match any of them.
>
Yeah. However if he's going to go that far, he might as well just
check for an mx record for the domain.
Also, that hash is going to get unwieldy pretty quick. If there's no
db already, might want to use sqlite.
Heh, too bad he didn't like my capcha of the email address for
confirmation. I kinda think that was one of my better ideas. :)
I agree -- I think you would spend considerable time attempting to
predict typos, when a simpler validation model could be written and
implemented relatively quickly. For instance, I would tackle this
problem with some straightforward client-side JavaScript. Before
passing the form results back to the server for processing (and further
validation if desired), you could use the prompt() or confirm() methods
of the Window object. With prompt(), you could require the user to
enter the address a second time. With confirm(), you could force them
to inspect the address before continuing on with submission. I'm not
sure if web bots could work through this logic and still spam you...
I'm not a big fan of my own suggestion, since encountering dialog boxes
while browsing can be annoying to the user. But, I think most types of
entry validation annoy users, even if it's for their own good. IMO, the
Capcha idea is probably the best "bang for the buck"; requires only
moderate coding (some are just copy-paste code snippets) and gives you a
high level of "human" authentication. The downside is that the capcha
phrases are sometimes ambiguous, and the user might have to try more
than once to submit.
A quick Google search revealed an article you may find useful, if you'd
still like to tackle the problem with your original idea:
http://www.infoq.com/articles/lucene-did-you-mean
Granted, it's not a Perl solution, but it is the same programming logic
you would need. Notice that it requires a suitable dictionary of
reference words (e-mail domains for your case) so you would still have a
lot of work to do...
Good Luck!
Brian
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/