I have created a php forgotten password page but when I receive the forgotten password email, I only get the email address in the email and not the username and password, its not collecting the username and password data for some reason
The php coding is below in the forgottenpassword.php
Code: Select all
<?php
if($go == "1")
{
$connect = mysql_connect("host","username","password");
if (!$connect)
{
die("MySQL could not connect!");
}
$DB = mysql_select_db('databasename');
if(!$DB)
{
die("My SQL could not select Database!");
}
}
$Username = $_POST['username'];
$Email = $_POST['email'];
$Email1 = "@";
$Email_Check = strpos($Email,$Email1);
$Password = $_POST['password'];
$message_field = $_POST['username, password'];
$message = "$Email, $Username, $Password, $message_field";
?>
<?php
//These are the variables for the email
$sendto = $_POST['email']; // this is the email address collected from the form
$ccto = "ianhaney@irhwebsites.co.uk"; //you can cc it to yourself
$subject = "Your Registration Details"; // Subject
$message = "Email Address: " . $Email . "\n\n" . "Username: " . $Username . "\n\n" . "Password: " . $Password . "\n\n" . "$message_field";
$header = "From: ianhaney@irhwebsites.co.uk\r\n";
$header .= "Reply-to: ianhaney@irhwebsites.co.uk\r\n";
// This is the function to send the email
mail($sendto, $subject, $message, $header, $message_field);
echo "Your password has been sent to ". $Email .".";
?>
Email Address: ianhaney@irhwebsites.co.uk
Username:
Password:
Can someone help me please, been trying to solve this for a few hours now lol