Checking existing email

I want you opinion for the algorithm I have set up for checking the email that user attempts to put as new.
The logic here is that he does not enter an e-mail that is same with another user’s.

What I do is the following…once the email is valid…with every keystroke an AJAX request is sent to the server where the newly entered email is cross-checked with the ones is the database.

What troubles me here is the fact that for every key stroke(and if the mail is valid)a request is made-and I do not know how efficient is this.

In general how do you see the above strategy?

I would check the email when the user is done typing. otherwise you may get many false positives up to the @.

and PHP’s test function for emails requires the full email address as well.

additionally I’d set a UNIQUE constraint on the email field in the DB.

1 Like

How am I going to understand that?

To which function are you referring to?Can you be more specific please?

  1. for instance on the blur event of the email field.

  2. filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)

there is something else too…I am thinking that this might feature might be wrong to put it-if I inform the user that there is an e-mail already in the database(of another user’s) privacy issues will be raised…

What do you think?

I think that you may be setting yourself up for a world of hurt when people keep trying to contact you because they think they signed up several months ago but can’t be sure. Can you find their account details for them please? Pretty please?

There’s not much wrong with telling people “That email address has already been taken”. It’s a good clue to users that instead of trying to create a new account, they should attempt to reset their password instead.

If you want to do something about people scraping for already used emails, you can set a limit of something like 3 attempts per minute, and 10 attempts per hour.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.