<?php  ob_start();



session_start();



require_once("../dbconnect.php");



if(isset($_POST['emailaddre']))



{



$query="select * from mec_admin where mec_email='".$_POST['emailaddre']."'";



$exe=mysql_query($query);



$num=mysql_num_rows($exe);



$row=mysql_fetch_array($exe);



if($num>0)



{



$uname=$row['mec_username'];



$pass=$row['mec_password'];



$email=$row['mec_email'];







$from1 = $row['mec_email'];



$headers = "From: ".$from1; 







$message.="YOUR USER ID AND PASSWORD\n\n";



$message.='User Name : '.$uname."\n";



$message.='Password  : '.$pass."\n\n";











$email_to = "To: ".$email;



$headers = "From: ".$from1; 







 $email_message=$message;



$email_subject = "Admin Password from Wedding Priest"; 



mail($email_to,$email_subject,$email_message,$headers); 



header("location:forgorpsw.php?s=suc");



}



else



{



header("location:forgorpsw.php?n=no");



}



}



?>