function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } mt_srand(make_seed()); $randval = mt_rand(); if (isset($_POST['submit'])) { $emailadd = ($_POST['email_address']); mysqli_select_db($t_cms, $database_t_cms); $sql = "SELECT * FROM members WHERE (e_address='".$emailadd."')"; $r = mysqli_query($t_cms, $sql); $row_r = mysqli_fetch_assoc($r); if(!$r) { $err=mysqli_error($mysqli); $sprint=$err; } if(mysqli_affected_rows($t_cms)==0){ $sprint="No such email address exists in our system. Please try again."; } else { $row=mysqli_fetch_array($r); $to=$emailadd; $subject="Reset Password Request on Pennaba.org Website"; $from="staff@pennaba.org"; $content="The reset password link below is only valid one time. Once you click and reset your password, it becomes unusable. If you do not reset your password after clicking on the link, please click the Forgot Password link on the website to reset your password again. \n\nTo reset your password on the Pennaba.org website, please click or copy the following link: https://pennaba.org/resetpass.php?".$randval; mail($to, $subject, $content, "From: $from"); $sprint="An email to reset your password has been sent to the email address we have on file."; $sql2 = "INSERT INTO reset_password (user_id, reskey) VALUES ('$emailadd', '$randval')"; mysqli_select_db($t_cms, $database_t_cms); $Result1 = mysqli_query($t_cms, $sql2) or die(mysqli_error($mysqli)); } } ?>
Enter your email address below and a link to reset your password will be emailed to the account we have on file.