php - Need to hash emailed 'verification' URL? -
I have a form that collects basic user information on a later page this user will enter a 'verification' code To be sure that they have access to the email account.
In addition, in some event, a person has accidentally left the site before entering his validity code, I will provide a link with a unique $ _GET variable so that they verify their email address Able to
Some questions:
- Is there a disadvantage in collecting the verification code in the plain site next to the email address of the customer (this code is 12345)?
- Need a 'hash' verification URL $ _GET variable? I thought that only 64 characters create string, add at the end of the URL and check against the database value (again stored with email address).
I could never do that user password (leave in open non-hashed) but in this situation, what is the proper method?
Edit
It seems that people are like GUID thoughts (though I'm not sure that this is more typical than saying 64 characters randomly generated strings). Does the function look enough below?
function getGUID () {if (function_exists ('com_create_guid')) {return com_create_guid (); } Other {MT_SEND ((double) microgram () * 10000); // Optional for PHP 5.2.0 and up $ Charid = strtoupper (md5 (uniqid (rand (), true))); $ Hyphen = "-"; $ Uuid = "{" .substr ($ charid, 0, 8) $ Hyphen .substr ($ charid, 8, 4). $ Hyphen .substr ($ charid, 12, 4). $ Hyphen .substr ($ charid, 16, 4) $ Hyphen .substr ($ charid, 20,12) "}"; Refund $ uuid; }}
Just use a GUID and forget about it! If you want this, you can store it in another table. No need it.
Comments
Post a Comment