<html>
<!-- email_password_process.php - the form page for sending an email -->
<head><title>Sending your Password through an Email</title></head>
<?php
include("includes/header.php");
include("includes/connection_config.php");
?>
<body>
<?php
$link = mysql_connect($host, $user, $password);
//first generate a query to get the password from the database
$email_row = mysql_db_query($db_name, $email_query, $link);
$mail_body = "your password is: ";
mail($txt_original_email, "Your Password', "$mail_body $password");
$query_string = "SELECT * FROM profile WHERE (email = '$txt_original_email' AND password = '$txt_original_password')";
// executing the SQL statement
$result_set = mysql_db_query($db_name, $query_string, $link);
// if the resultset has any entries then you need to let the Shopper
// know the email address is already in use
if (mysql_fetch_array($result_set))
{
mysql_close($link);
header("location:email_password_process_validate.php");
}
else
{
mysql_close($link);
header("location:email_password_process_failed.php");
}
?>
</body>
</html>
Did you copy paste this code? Because if so...
mail($txt_original_email, "Your Password', "$mail_body $password");
Your second argument starts with a double quote, yet ends with a single quote, thus throwing pretty much the rest of your script off. I noticed this right away because the syntax highlighting in your original post is red from this point on. Let's fix it and see what happens...
<html>
<!-- email_password_process.php - the form page for sending an email -->
<head><title>Sending your Password through an Email</title></head>
<?php
include("includes/header.php");
include("includes/connection_config.php");
?>
<body>
<?php
$link = mysql_connect($host, $user, $password);
//first generate a query to get the password from the database
$email_row = mysql_db_query($db_name, $email_query, $link);
$mail_body = "your password is: ";
mail($txt_original_email, "Your Password", $mail_body, $password);
$query_string = "SELECT * FROM profile WHERE (email = '$txt_original_email' AND password = '$txt_original_password')";
// executing the SQL statement
$result_set = mysql_db_query($db_name, $query_string, $link);
// if the resultset has any entries then you need to let the Shopper
// know the email address is already in use
if (mysql_fetch_array($result_set))
{
mysql_close($link);
header("location:email_password_process_validate.php");
}
else
{
mysql_close($link);
header("location:email_password_process_failed.php");
}
?>
</body>
</html>
Yep, looks a lot better. Plug that in, see what happens.
James