<?php
include("config.php");

$user=$_SESSION['user'];

$set=mysql_query("select * from `user_account` where `username`='$user'");
$fet=mysql_fetch_array($set);
$username=$fet['username'];
$password=$fet['password'];
$email=$_REQUEST['email'];

if($email==$username)
{
       $to =$email;
       $subject = "".$email_title_website." - Forgot Password";
	   
	   $headers  = 'MIME-Version: 1.0' . "\r\n";
       $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
       $headers .= 'From:<'.$adminemailid.'> ' . "\r\n";
       $headers .= 'Cc: ' . "\r\n";
       $headers .= 'Bcc: ' . "\r\n";
      $headers .= '"Content-type: text/plain; charset=iso-8859-1"'; 
      $headers.="X-Priority: 3\r\n"; 
      $headers.="X-Mailer: smail-PHP ".phpversion()."\r\n"; 
	  $body = "Your password is ".$password."";
	  mail($to,$subject,$body,$headers);
	  
	  ?><script>window.location="forgotped.php?pwd=yes";</script><? }else{
      ?><script>window.location="forgotped.php?pwd=no";</script><? } ?>