Re: registration form with activation code sent to user
| From: | Joseph Crawford | Date: | Thu, 16 Jun 2005 15:29:31 +0000 |
| Subject: | Re: registration form with activation code sent to user | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-39693@lists.php.net to get a copy of this message | ||
#2
Well when the user registers there will have to be a database table for
members i assume, why not make a column confirmation or something and store
this string there?
#3
Check into the mail() function, this will allow you to send custom headers
etc.. You just create the body of the message something like this
$body = 'Thank you for registering with us<br>';
$body .= 'You must now confirm your email address by clicking
here<http://yourdomain.com/confirm.php?email=users@domain.com&code=sdjfhasf80g7ad9fgfg>
the actual url for the clicking here link you need to create maybe something
like <a href="
yourdomain.com/confirm.php?email=users@domain.com&code=sdjfhasf80g7ad9fgfg"<http://yourdomain.com/confirm.php?email=users@domain.com&code=sdjfhasf80g7ad9fgfg">>clicking
here</a>
then you use the mail() function to send the mail to the users email
address...
on the confirm.php page you should grabe the "code" and "email" using
$_GET['code'] and $_GET['email'] then check the database for the users email
and make sure the code matches the one in the database. If it does mark them
as confirmed and let them proceed, if not well do nothing.
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl@gmail.com