I'm not new to programming, but I am new to web programming. I'm
wanting to do a website with forums, chats, and other features and
I'm wondering how to have an activation link.
I'm not wondering how to send the email specifically, but I want to know
how do I handle the part where someone clicks in the email to go to
activate the new account and the account gets activated when they
go to that page? I'm assuming this means I have special parameters
like when you go to a page and there's a ? after the name of the file
and certain parameters. I don't know what this is called so I couldn't
google it to find out. Anyways, I'm guessing I'd need to create a special
code in my database for the new user and when they click in their email
it directs them to the web site using the code as a parameter. How is this done? Thanks.
account activation link sent by email
Started by jimiwa, Nov 04 2009 10:33 AM
1 reply to this topic
#1
Posted 04 November 2009 - 10:33 AM
|
|
|
#2
Posted 04 November 2009 - 11:17 AM
When I did this my table structure looked like this:
When they register fill them all out, activated would be default at 0, if it's 1 they are activated. The code needs to be something that you make up, but it needs to be long enough to be unique. You might md5 the username/email and the current time or something.
Email them the code with a link:
site.com/activate.php?code=123456code&email=user@site.com
Validate that the code matches the email address and then switch the "activate" to 1 if it matches up
Quote
id, name, email, password, activated, code
Email them the code with a link:
site.com/activate.php?code=123456code&email=user@site.com
Validate that the code matches the email address and then switch the "activate" to 1 if it matches up
Quote
UPDATE `users` SET `activated`=0 WHERE `email`='$email' && `code`='$code'


Sign In
Create Account


Back to top










