I'm pretty new to PHP, however, I'd say I have quite a good understanding of it.
I'm currently writing a sign up script which is basically a registration form which enters info into a database and a login form which does something with sessions (I'm still learning about that ;p)
Now, I may be wrong, so if I am, please correct me...
What I need to do is, when someone submits the registration form; enter a random activation code into the member’s row under a new field like “activation_code”.
Then I would use PHP mail() to send an email to the person who has just signed up a link to activate their account with a URL which is something like activate.php?do=ACTIVATIONCODE
When they click the link sent in the email, the script will check the activation code at the end of the URL against that of the one in the database. If they match the members field, change the group field from (say) 1 to 2 (1 being not activated, 2 being activated and having full access to members pages)
My question is, how would I generate such a code? Also, how would I get the script to recognise that someone has gone to activate.php?do=ACTIVATIONCODE and use the activation code in the URL to check if it matches that of the one in the database?
Any help here would be brilliant, thanks
I'm currently writing a sign up script which is basically a registration form which enters info into a database and a login form which does something with sessions (I'm still learning about that ;p)
Now, I may be wrong, so if I am, please correct me...
What I need to do is, when someone submits the registration form; enter a random activation code into the member’s row under a new field like “activation_code”.
Then I would use PHP mail() to send an email to the person who has just signed up a link to activate their account with a URL which is something like activate.php?do=ACTIVATIONCODE
When they click the link sent in the email, the script will check the activation code at the end of the URL against that of the one in the database. If they match the members field, change the group field from (say) 1 to 2 (1 being not activated, 2 being activated and having full access to members pages)
My question is, how would I generate such a code? Also, how would I get the script to recognise that someone has gone to activate.php?do=ACTIVATIONCODE and use the activation code in the URL to check if it matches that of the one in the database?
Any help here would be brilliant, thanks






