From 62966c82fa6f643acbef5e5e870b220dba851e36 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Sat, 26 Oct 2024 09:46:29 +0800 Subject: [PATCH] Script.php: remove RESET Password stuff because there is no form with ID 'form_reset_password' --- Script.php | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/Script.php b/Script.php index 5b6c92c..ce42cf1 100644 --- a/Script.php +++ b/Script.php @@ -290,51 +290,6 @@ if (!empty($_POST["form_recover_password"])) { } } -// ################################ RESET Password ##################################### - -if (!empty($_POST["form_reset_password"])) { - $password = mysqli_real_escape_string($con, $_POST["password"]); - $token = mysqli_real_escape_string($con, $_POST["token"]); - $email = mysqli_real_escape_string($con, $_POST["email"]); - $result = mysqli_query( - $con, - "SELECT * FROM Users_Table WHERE email='$email'" - ); - if (mysqli_num_rows($result) == 0) { - - echo "invalid email"; - return; - } else { - while ($row = mysqli_fetch_assoc($result)) { - - $userid = $row['User_ID']; - - $email = $row['Email']; - $id = $row['Student_ID']; - - $user_token = $userid * $userid * $userid + $userid * 0.00343; - if ($user_token == $token) { - // Password Update - - // Password Update - $hashed_password = hash('sha512', $password); - $sql = "UPDATE users_table set HashPassword='$hashed_password' where User_ID='$userid';"; - if ($con->query($sql) === TRUE) { - - error_reporting(0); - - $_SESSION["info_login"] = " Password changed successfully , you can login now with your new password "; - header("Location: index.php"); - } else { - echo "Error: " . $sql . "
" . $con->error; - } - } else { - echo "Invalid Token "; - } - } - } -} - // ############################### CREATE Lecturer/TA USER ################################## if (!empty($_POST["form_createlecturer"])){ $email = mysqli_real_escape_string($con, $_POST["email"]);