define("TITLE", "Password Retrieval");
include("header.php");
if($HTTP_GET_VARS["func"] == "lost"){
retrievepassword();
}else{
findinfo();
}
function findinfo(){
?>
Please enter the email address you registered with.
}
function retrievepassword(){
mysql_connect("localhost", "marinetw", "usmarines7") or die(mysql_error());
mysql_select_db("marinetw_memberdatabase") or die(mysql_error());
global $HTTP_POST_VARS;
$email = $HTTP_POST_VARS["email"];
$result = mysql_query("SELECT id, email, password FROM members WHERE email='$email' ");
while($row = mysql_fetch_array($result)){
$password = $row["password"];
}
$subject = "Your password has been retrieved";
$receiptMessage = "You are receiving this message because you or someone else has requested your password to Christian Polygyny. "
."As a security precaution passwords are only sent to the email address that the membership was registered with. "
."Your password is ".$password."\n\nThank you for your time. Take care and God bless.";
mail($email, $subject, $receiptMessage,"From: PasswordRetrieval@polygyny.dukeofmarshall.com");
mysql_close();
echo "
Your password has been sent to the email address that your membership was registered with.
";
findinfo();
}
?>