Hi, could someone please tell me how to make one of those e-mail confirmations scripts, so that when I user signs up to a site, they are e-mailed a 10 digit code of numbers, that they must submit somewhere on the site to confirm there account. Hopefully you understand what I mean. If not, I'll explain further.
Thanks.
PHP Email confirmations
Moderator: General Moderators
If you know PHP this should be a pretty easy thing to do really.
On the PHP page that the form is submitted to is where you will need to put the email stuff.
First of all create your four digit code....
That's that done.
Now you will need to store that number in a database along with the username and password etc.
To send an email use....
....and remember to include a link to your 'code entry' page and remember to include the code number.
When the user enters their code number, username, and password on the 'code entry' page just check the info against the data you stored in the database when the email was sent.
On the PHP page that the form is submitted to is where you will need to put the email stuff.
First of all create your four digit code....
Code: Select all
<?php
$nums = Array('0','1','2','3','4','5','6','7','8','9','0');
shuffle($nums);
$code = $nums[0].$nums[1].$nums[2].$nums[3];
?>Now you will need to store that number in a database along with the username and password etc.
To send an email use....
Code: Select all
<?php
mail($to,$subject,$body,$from);
?>When the user enters their code number, username, and password on the 'code entry' page just check the info against the data you stored in the database when the email was sent.