View Full Version : script for confirmation via email ( for registration)??

01-11-2006, 06:14 AM
i had planned to use the popular concept for membership ie verification by email..
I am trying to make the registration form which has email(username),password,re-password fields.....Once the form is submitted then the confirmation link should be emailed to the user with some unique 32 bit numbers.....Once clicked on the link then his membership should be active.......
Can anybody help me with the neccesary code or examples about how this email verification can be carried out for membership..................???
I would be very greatful if this problem is solved........
Again thanks in advance.....

Velox Letum
01-11-2006, 06:56 AM
What I do is when they register, I insert two rows. One row into the users table, and another into an activation table. The id of the activation row is randomly generated (sha1(mt_rand()) for me), and then the id is emailed to the user. They click the link and it goes to a script which queries the activation table. In mine it clears any activation older than 48 hours out first though. If it exists, then it update's the users row and deletes the activation row.

Rich Pedley
01-11-2006, 10:39 AM
I use a similar system but only use one row
email address, active(yes/no), date, random string

when they first apply the email address gets added along with the default of no followed by the date and a random string. They are then sent an email requesting that they fill in a further form to confirm (obviously this could be done dynamically using $_GET.

To unsubscribe they have enter the same random string (or reuqest a reminder of it).

Plus and unactivated email addresses can get removed on whatever basis.

01-11-2006, 02:51 PM
Have a read through this tutorial