Jump to content

Email verification for new users?


virtuexru

Recommended Posts

Ok, so I have a registration form setup. And now I'm wondering, how do I automatically send them an email with their username and password after they have successfully signed up? I have the following variables:

[code]
$user = $_POST['user_id'];
//get username from form
$pass = $_POST['user_password'];
//get password from form
$pass2 = $_POST['user_password2'];
//password check
$name = $_POST['fullname'];
//get name from form
$domain = $_POST['domain'];
//get domain from form
$zip = $_POST['zip'];
//get zip from form
$city = $_POST['city'];
//get city from form
$email = $_POST['email'];
//get email from form
$state = $_POST['state'];
//get state from form
$country = $_POST['country'];
//get country from form
$address = $_POST['address'];
//get address from form
$phone = $_POST['phone'];
//get phone from form

//after all the verification...

    $request = "INSERT INTO tbl_auth_user values('$user',PASSWORD('$pass'),'$name',
    '$email','$domain','$zip','$city','$state','$country',
    '$address','$phone')";
    $results = mysql_query($request);
    if($results) //if this operation goes smooth we send the visitor to a
    //previously created error page
    {
        header("Location: accountok.php"); //the user will be sent to this page
    }
    else //is any kind of issue is found
    {
        header("Location: error-account.php"); //the user will be sent to
        //this previously created page
    }
    mysql_close($link); // we close the connection
    Die();
[/code]
Link to comment
https://forums.phpfreaks.com/topic/26374-email-verification-for-new-users/
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.