FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

How to activate a user by using emails?

 


liangzou
When I registered the account in Frihost, I got an email which had a link to activate my account. I'm developing a web application and I need to use this technique. The url was
http://www.frihost.com/account/activate.php?u=*****&act_key=*****. Can someone tell me what is the act_key and how it is stored in the user database? Thank you very much for your help.
MrBlueSky
It works something like this:

1. When a new user signs up, a unique key is created (this is the activation key in the url) and it is stored in the database together with the userid.
2. When a user clicks on the activation link the key is looked up in the database and the user with the id which is linked to the key is activated
3. The key is removed from the database.

There are several ways to create (semi) unique ids. For example you can use PHP's uniqid() function. This functions returns a string, so you have to store it in the database in a string-type column (for example VARCHAR).
liangzou
Cool. Thank you so much for your answer. The principle is the most important thing to know. Thanks again. Smile
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.