How to validate the user after registration?

Hi all,
I want to validate the user after registering into the site… send an confirmation mail to validate email provided by the user and also to active the user,when the user clicks the link through their mail box…
I want one example to do it…

Thanking you,…

The basic process would be along these lines -

  1. Have a column in your database user table called “activated” which is initially set to 0 on registration.

  2. When the user record has been added to the user table at registration send an email to the user’s email address with a link in the email pointing to a php script that activates the user. The query string attached to the link’s url will need to have some sort of unique identifier for the user in it so the script will know which user to activate. The script sets the value of “acivated” to 1 for that user.

  3. Every time the user logs in to their account, then as well as checking their username/password you also have to make sure that “activated” = 1.