From e3dafae6220d2e3d6420e80c75271f19b94b8fd1 Mon Sep 17 00:00:00 2001 From: CloudStarTreck <37251906+Teecloudy@users.noreply.github.com> Date: Thu, 19 Mar 2020 19:49:41 +0800 Subject: [PATCH] Removing the 'HashPassword' Column Edited by Ashly Removed the insertion of encripted password into the 'HashPassword' column. All passwords are kept in the 'Password' Column. Also adjusted the Column size of database to hold the long hashed password --- Script.php | 5 ++--- lrr (1).sql | 2 +- lrr_datbase.sql | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Script.php b/Script.php index 5a84f98..968faae 100644 --- a/Script.php +++ b/Script.php @@ -123,10 +123,9 @@ if (!empty($_POST["frm_signup_1"])) { return; } //applying password_hash() - $sha512=hash('sha512', $password); $password_hash = password_hash($password, PASSWORD_DEFAULT); - $sql= "INSERT INTO `users_table`(`Email`, `Password`, `HashPassword`, `Full_Name`, `UserType`, `Student_ID`, `Passport_Number`) VALUES " - . "('$email','$password_hash','$sha512','$fullname','Student','$student_id','$passport')"; + $sql= "INSERT INTO `users_table`(`Email`, `Password`, `Full_Name`, `UserType`, `Student_ID`, `Passport_Number`) VALUES " + . "('$email','$password_hash','$fullname','Student','$student_id','$passport')"; if ($con->query($sql) === TRUE) { header("Location: Courses.php"); diff --git a/lrr (1).sql b/lrr (1).sql index c8b3fc8..f11c54f 100644 --- a/lrr (1).sql +++ b/lrr (1).sql @@ -187,7 +187,7 @@ CREATE TABLE `students_data` ( CREATE TABLE `users_table` ( `User_ID` int(11) NOT NULL, `Email` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL, - `Password` varchar(50) CHARACTER SET utf8 DEFAULT NULL, + `Password` varchar(250) CHARACTER SET utf8 DEFAULT NULL, `Full_Name` varchar(50) CHARACTER SET utf8 DEFAULT NULL, `UserType` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL, `Student_ID` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL, diff --git a/lrr_datbase.sql b/lrr_datbase.sql index d31c47a..f51d681 100644 --- a/lrr_datbase.sql +++ b/lrr_datbase.sql @@ -249,7 +249,7 @@ INSERT INTO `students_data` (`ID`, `Student_ID`, `Passport_Number`) VALUES CREATE TABLE `users_table` ( `User_ID` int(11) NOT NULL, `Email` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL, - `Password` varchar(50) CHARACTER SET utf8 DEFAULT NULL, + `Password` varchar(250) CHARACTER SET utf8 DEFAULT NULL, `Full_Name` varchar(50) CHARACTER SET utf8 DEFAULT NULL, `UserType` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL, `Student_ID` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL,