From a238909f1af95f234e5a4ad404802c9251e8ea60 Mon Sep 17 00:00:00 2001 From: Samantha <37825989+Samrusike@users.noreply.github.com> Date: Fri, 25 Dec 2020 22:09:36 +0800 Subject: [PATCH] Update Script.php Line 44, 53 - 60 we removed the passport portal not just from the form as our colleagues did but completely. Apart from the change above we also added a portal for inputting the student number on line 64. --- Script.php | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Script.php b/Script.php index b00e8d5..2c36ed5 100644 --- a/Script.php +++ b/Script.php @@ -41,7 +41,6 @@ function is_valid_student_number($student_id) { if (!empty($_POST["frm_signup_1"])) { $student_id = trim( mysqli_real_escape_string($con, $_POST["student_id"]) ); - $passport = trim( mysqli_real_escape_string($con, $_POST["passport"]) ); // validate student number if (! is_valid_student_number($student_id)) { @@ -50,14 +49,6 @@ if (!empty($_POST["frm_signup_1"])) { return; } - // passport should be empty (not used) - if (strcmp($passport, '') != 0) { - $_SESSION["info_signup1"] = "Passport is disused. Please leave it empty."; - header("Location: index.php"); - return; - } - - // Check if this student number is a legal one $result = mysqli_query($con, "SELECT * FROM `students_data` WHERE Student_ID='$student_id'"); if(mysqli_num_rows($result) == 0) @@ -70,8 +61,7 @@ if (!empty($_POST["frm_signup_1"])) { $result98 = mysqli_query($con, "SELECT * FROM `users_table` WHERE Student_ID='$student_id'"); if(mysqli_num_rows($result98) == 0) { - $_SESSION['user_student_id'] = $student_id; - $_SESSION['user_passport'] = $passport; + $_SESSION['user_student_id'] = $student_id; header("Location: signup.php"); return; } @@ -84,9 +74,6 @@ if (!empty($_POST["frm_signup_1"])) { } - - - // ############################### CREATE STUDENT USER ################################## if (!empty($_POST["frm_signup_2"])) { $fullname = mysqli_real_escape_string($con, $_POST["fullname"]);