Activation Links & Mysql

Caporegime
Joined
18 Oct 2002
Posts
25,287
Location
Lake District
When a user registers an account I want to validate their email address by sending them and activation link. What http variables does the link usually include? Is it the id of the user and the md5 hash of the password?
 
Anything that they can't guess, so a hash of their password is a bad idea unless it's salted.

Just md5(rand() * time()), add to a field in the database, and put the link in the email as userid=<id>&hash=<hash>. If it matches, delete the hash and verify them :)
 
Back
Top Bottom