|
Posted by Pedro Graca on 01/19/06 22:17
Bert Bos wrote:
> when users are register on our website, their username, encrpyted
> password and so on are stored in the mySQL database.
>
> Many phpbb sites though send an activation mail to the email address
> specified by the user. The user then needs to select a link to get his
> account activated.
>
> I would like to implement this process, can anyone tell me how this is done?
After the registration data is saved to the database, send them a link
to a validate.php script
http://www.example.com/validate.php?code=78Jh5qM0
The code in the link could be random and saved to the database.
When, later, the user access the script, you search the database for the
code and update the record indicating that this particular user has
validated.
$sql = "update user_table set validated=1 where code='{$_GET['code']}'";
Make sure every (unvalidated) code is unique in the database.
Also try to prevent people from validating random accounts by locking
out a 'connection' that fails after three (or whatever) attempts.
Hope this helps.
--
If you're posting through Google read <http://cfaj.freeshell.org/google>
Navigation:
[Reply to this message]
|