include("incs/config.php");
if($_POST['mode']=="_forgotpassword")
{
$email = $_POST['email'];
$res = mysql_query("select * from users where email='$email'");
if(mysql_num_rows($res))
{
$row = mysql_fetch_array($res);
$to = $row['email'];
$subject = "Your userid and password";
$body = "Hi, ".$row['name']."
";
$body .= "Username : ".$row['username']."
";
$body .= "Password : ".$row['password'];
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ADMIN";
mail($to,$subject,$body,$headers);
$msg = "Your UserID and Password have been send to you email address";
}
else
{
$msg = "Email address not found";
}
}
?>