Jump to content

Confirmation e-mails?


Mutley

Recommended Posts

you would

- make a field in the user's table called "active" or some other such thing and set it to 0 by default.
- make a seperate table called "activationCodes" with fields "code" and "userId"
- in your registration processing script (the part that inserts the user's info into the db), generate a random alpha-numeric string. Lots of methods out there.
- Insert the user's id and the code into activationCodes. 
- mail the code to the user. see jesirose's post, as far as mailing. 
- make a script where the user can enter in the code.  Your script will then change the user's "active" to 1, where the user's id matches the userid associated with the code in the activationCodes table.  A lot of people like to make this script accept the code through the url, and then send a link to the page with the code passed through the url, for the user's convenience.  The email would then look something like this:

[code]
hello user, your code is: lksdf23lkj0d903kd

you can click on this link here to get activated:
http://www.yoursite.com/activate.php?code=lksdf23lkj0d903kd

if for some reason the link is broken or otherwise mangled, just go and manually enter it in, etc.. blahblahblah.

the end.
[/code]

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.