Re: Random String Generation
| From: | Pete James | Date: | Wed, 12 Mar 2003 19:08:30 +0000 |
| Subject: | Re: Random String Generation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139366@lists.php.net to get a copy of this message | ||
The method I use is to take their user_id or email and create an HMAC
(hashed message authentication code) by hashing it with a secret key on
my end. This way the activation link looks like the following:
http://mysite.com/activation.php?user_id=petej&ID=ghjghjg367ghjlkj9hjlkj
THe activation script takes the user_id they passed in and hashes it
with the secret key again. The result should match the ID they passed.
Easy and pretty secure.
HTH.
Pete.
Mike Walth wrote:
>
> Hello:
>
> What I am trying to do is to create a email verification routine with PHP.
> When people register on the site they will get an email sent to them with a
> link such as
> http://mysite.com/activation.php?ID=ghjghjg367ghjlkj9hjlkjhn0
>
> That way when they click on the link it will verify the code against the
> database and activate their account. Does anyone know an easy way to create
> this string?
>
> Thank you,
>
> Mike Walth
> CinoFusion
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php