FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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
Related topics
Change the password of a windows user using de DOS prompt
History of spam
Hackers try to take down U.K. cops
Forms
Need Help in PHP
Non capitalised topic titles
Discuss: Can AJAX run fine on linux Platform ?
How can I disable the back button of my browser?
Mail in Unix
Mail in Unix
del's design
WHAT YOU THINK IS ANTIVIRUS IS?
phpmyadmin login incorrect
mySQL question
Reply to topic    Frihost Forum Index -> Scripting -> Others

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