purify($_POST['email']); $resultemail=mysqli_query($link, "select * from `users` where email LIKE '$email' LIMIT 1"); if (mysqli_num_rows($resultemail)=='0'){ $note="The email address you entered does not exist"; $notecolor="danger"; $noteicon="ban"; } else { // get user id $resulttheirid=mysqli_query($link, "select * from `users` where email LIKE '$email' LIMIT 1"); while ($rowtheirid=mysqli_fetch_array($resulttheirid)){ $theirid=$rowtheirid['id']; $theirname=$rowtheirid['firstname']; } $token=rand(00000000000,9999999999); $sql = "UPDATE users SET token='$token' WHERE id='$theirid'"; mysqli_query($link, $sql); $mailbody="Hi ".$theirname.",

"; $mailbody=$mailbody."Please click on this link to reset your password: ".$sysdomain."/reset.php?email=".$email."&token=".$token."

"; $mailbody=$mailbody.$sysname."
"; $mailbody=$mailbody.$sysemail; SendEmail($email, 'Password Reset', $mailbody); $note="Please check your email for reset instructions"; $notecolor="success"; $noteicon="check"; } } ?> RemitX