Page 1 of 1

confirmation code for registration??

Posted: Mon Jan 09, 2006 10:24 pm
by PHPycho
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..................???
Again thanks in advance.....

Posted: Mon Jan 09, 2006 10:41 pm
by feyd
The systems I have dealt with used a uniquely generated activation code which was stored into a field within the user's record in the database. The link would often contain the user's id/name and of course, their verification code. A lot of systems will also incorporate a "manual" verification whereby they are told that if the link doesn't work for them by whatever reason, to go to the site, click on "verify", give their username and the verification code (separated from the link to make it easier for them to copy it correctly).

Posted: Tue Jan 10, 2006 12:59 am
by josh
Or you could do something original that no one else is doing, and just send them an email that says all they have to do is reply to it to activate their account, you'd have to pipe your incoming mail to a PHP script which may not be the easiest thing to set up, definitely do what feyd is suggesting if you just want the vanilla version of this, with a unique validation code. Generally this kind of thing is implemented by generating a random string called a token and storing that token into the database (users table), then you send an email to the user with a link, the link has to point to a php script that removes the token out of the database and then sets a flag on your users table for whatever user the token belonged to.