its said
Notice: Undefined variable: sentmail in C:\xampp\htdocs\caliph collection\php_site\forgot_password_process.php on line 41. i cant find the problem
<?php session_start();
include "dbconnect.php"; //connects to the database
if (isset($_POST['username'])){
$username = $_POST['username'];
$query="select * from customer where customer_id='$username'";
$result = mysql_query($query);
$count=mysql_num_rows($result);
// If the count is equal to one, we will send message other wise display an error message.
if($count==1)
{
$rows=mysql_fetch_array($result);
$pass = $rows['password'];//FETCHING PASS
//echo "your pass is ::".($pass)."";
$to = $rows['email'];
//echo "your email is ::".$email;
//Details for sending E-mail
$from = "CC";
$url = "http://www.caliphcollection.com/";
$body = " password recovery Script
-----------------------------------------------
Url : $url;
email Details is : $to;
Here is your password : $pass;
Sincerely,
Caliph Collection";
$from = "caliphcollection@gmail.com";
$subject = "Password recovered";
$headers1 = "From: $from\
";
$headers1 .= "Content-type: text/html;charset=iso-8859-1\\r\
";
$sentmail = mail ( $to, $subject, $body, $headers1 );
} else {
if ($_POST ['username'] != "") {
echo "<span style='color: #ff0000;'> email not found.</span>";
}
}
//If the message is sent successfully, display sucess message otherwise display an error message.
if($sentmail==1)
{
echo "<span style='color: #ff0000;'> Your Password Has Been Sent To Your Email Address.</span>";
}
else
{
if($_POST['username']!="")
echo "<span style='color: #ff0000;'> Cannot send password to your e-mail address.Problem with sending mail...</span>";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home: Webpage</title>
</head>
<body>
<form action="" method="post">
<label> Enter your User ID : </label>
<input id="username" type="text" name="username" />
<input id="button" type="submit" name="button" value="Submit"/ >
<input id ="reset" type='reset' value='Reset' />
</form>
</body>
</html>