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
https://forums.phpfreaks.com/topic/34998-confirmation-e-mails/#findComment-165072
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.