Jump to content

Confirmation URL


pranshu82202

Recommended Posts

I have created a registration form for my website.

I want that, whenever any user register to my website an automated mail is send to the Email (with an confirmation link of registration) which he had given their....

 

I am able to send mails via smtp but dont know how to create a confirmation link url...  :confused: :confused: :confused: :confused: :confused:

 

I thought so that it must be the cookie which automatically generated on the registration.. :wtf:

 

I need your help..

 

Thanx in advance...

Link to comment
Share on other sites

When a user registers you can just generate a unique code for that user, store it in the database and then send the user an email with a url using that unique code as a parameter of the url.

 

Here is an outline of the steps you could take:

 

1. User registers on your site.

2. Create a "random" code. For example you could create an MD5 hash of their username and/or email address. Just make sure it will be unique

3. Store that value in a column in the user table (e.g. registration code).

4. Create a url (e.g. www.mysite.com/confirm.php?code=[random_code]) with that code as a parameter and send it to the user in an email

5. Create a page for that URL to point to (confrm.php). In that page grab the code using $_GET and do a MySQL query(ies) to update that user record to be "confirmed"

 

You also need to determine how to differentiate between confirmed/unconfirmed users. One easy method is to simply remove the confirmation code when the user confirms their account. Then if a user attempts to log in after checking the username/password you would check to see if there was a value for the confirmation code. If so, you provide a message that they need to confirm their account before logging in. Although, you would need to consider if you need to provide a means for someone to regenerate the confirmation email. Or even change the email if they mistyped it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.