0) {
mysqli_query($conx, "UPDATE forgot_password SET uqid='$resetid' WHERE email_secure='$c_email'");
mysqli_query($conx, "UPDATE forgot_password SET tstamp='$tstamp' WHERE email_secure='$c_email'");
mysqli_query($conx, "UPDATE forgot_password SET ua='$useragent_r' WHERE email_secure='$c_email'");
mysqli_query($conx, "UPDATE forgot_password SET ip='$ipaddr_r' WHERE email_secure='$c_email'");
}
else {
# INSERT RESET DETAILS
$innss = mysqli_query($conx, "INSERT INTO forgot_password (ip,ua,tstamp,uqid,email_secure,username) VALUES ('$ipaddr_r','$useragent_r','$tstamp','$resetid','$c_email','$c_username')");
}
# PUSH OUT EMAIL
$to = $email_p;
$subject = "misdew.com password reset";
$txt = "$c_username,
A password reset was requested for your account.
Follow the link below to continue.
http://misdew.com/forgot/reset.php?k=$resetid
";
$headers = "Content-Type: text/html; charset=utf-8";
mail($to,$subject,$txt,$headers);
$_SESSION['m4'] = "em_ss";
header("location: /forgot");
exit();
}
else {
$_SESSION['m3'] = "all_req";
header("location: /forgot");
exit();
}
session_destroy();
?>