virtuexru Posted November 6, 2006 Share Posted November 6, 2006 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 More sharing options...
xtentic Posted November 6, 2006 Share Posted November 6, 2006 check php.net for mailthat's all Link to comment https://forums.phpfreaks.com/topic/26374-email-verification-for-new-users/#findComment-120621 Share on other sites More sharing options...
Fuego Posted November 7, 2006 Share Posted November 7, 2006 $message = "$user -username\n";$message .= "$pass -password\n";$success = mail($to, $subject, $message, $headers);if ($success){ echo"<h2>message sent</h2>"; }else{ echo"<h2>message failed to send</h2>";} Link to comment https://forums.phpfreaks.com/topic/26374-email-verification-for-new-users/#findComment-120718 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.