confirmation code for registration??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

confirmation code for registration??

Post 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.....
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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).
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post 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.
Post Reply