';
// ++++++ may only need email1 and post, not get
$email1 = isset($_POST['email1']) ? $_POST['email1'] : $_GET['email'];
if($email1 == ""){
echo "
Error: we need your email address.
";
}
// check if email they enter is what we have in the database
$sqlAreTheyIn = "SELECT email, memberID FROM Members WHERE email = '".$email1."'";
$data = mysqli_query($conn, $sqlAreTheyIn);
$tCount=mysqli_num_rows($data);
if ($tCount > 0){
while($memberInfo = mysqli_fetch_assoc($data)) {
$trueEmail = $memberInfo['email'];
$memberID = $memberInfo['memberID'];
}
// during testing ++++++MAIL++++ go to me
// $trueEmail = "jimtestin@ProductiveAndHappy.com";
$str = "Hi there,\r\n";
$str .= "To change your password, visit: \r\n";
$str .= "https://www.BetterPhoto.com/a_02pwUpdaterSansSign.php?mem=" . $memberID . " \r\n";
$str .= "Thank you, \r\n";
$str .= "Jim \r\n";
// secure because they must be able to receive this email
$toAddress = $trueEmail;
$toName = "BetterPhoto Member";
mailerThatRocks($toAddress,"BetterPhoto Password Reset",$str, $toName, "bpsupport@betterphoto.com");
// success
echo "
Success! Check your email inbox for instructions on how to reset your password.
";
} else { // did not find email address in database
echo "
Error: we could not locate your in the database. Please make sure the email you enter is correct.
";
}
echo '
';
} else { // first time here
?>