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.SIMPLICITY_link
parent
6ba6ebe414
commit
a238909f1a
15
Script.php
15
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"]);
|
||||
|
|
Loading…
Reference in New Issue