forked from mrlan/LRR
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
13
Script.php
13
Script.php
|
@ -41,7 +41,6 @@ function is_valid_student_number($student_id) {
|
||||||
if (!empty($_POST["frm_signup_1"])) {
|
if (!empty($_POST["frm_signup_1"])) {
|
||||||
|
|
||||||
$student_id = trim( mysqli_real_escape_string($con, $_POST["student_id"]) );
|
$student_id = trim( mysqli_real_escape_string($con, $_POST["student_id"]) );
|
||||||
$passport = trim( mysqli_real_escape_string($con, $_POST["passport"]) );
|
|
||||||
|
|
||||||
// validate student number
|
// validate student number
|
||||||
if (! is_valid_student_number($student_id)) {
|
if (! is_valid_student_number($student_id)) {
|
||||||
|
@ -50,14 +49,6 @@ if (!empty($_POST["frm_signup_1"])) {
|
||||||
return;
|
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
|
// Check if this student number is a legal one
|
||||||
$result = mysqli_query($con, "SELECT * FROM `students_data` WHERE Student_ID='$student_id'");
|
$result = mysqli_query($con, "SELECT * FROM `students_data` WHERE Student_ID='$student_id'");
|
||||||
if(mysqli_num_rows($result) == 0)
|
if(mysqli_num_rows($result) == 0)
|
||||||
|
@ -71,7 +62,6 @@ if (!empty($_POST["frm_signup_1"])) {
|
||||||
if(mysqli_num_rows($result98) == 0)
|
if(mysqli_num_rows($result98) == 0)
|
||||||
{
|
{
|
||||||
$_SESSION['user_student_id'] = $student_id;
|
$_SESSION['user_student_id'] = $student_id;
|
||||||
$_SESSION['user_passport'] = $passport;
|
|
||||||
header("Location: signup.php");
|
header("Location: signup.php");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -84,9 +74,6 @@ if (!empty($_POST["frm_signup_1"])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ############################### CREATE STUDENT USER ##################################
|
// ############################### CREATE STUDENT USER ##################################
|
||||||
if (!empty($_POST["frm_signup_2"])) {
|
if (!empty($_POST["frm_signup_2"])) {
|
||||||
$fullname = mysqli_real_escape_string($con, $_POST["fullname"]);
|
$fullname = mysqli_real_escape_string($con, $_POST["fullname"]);
|
||||||
|
|
Loading…
Reference in New Issue