Update Script.php
Student can create the accounts on their own without the need for the Teacher to create the accounts for the students. Also removed the inputs for the passport.SIMPLICITY_link
parent
a238909f1a
commit
3ab9c33e8b
|
@ -77,11 +77,10 @@ if (!empty($_POST["frm_signup_1"])) {
|
|||
// ############################### CREATE STUDENT USER ##################################
|
||||
if (!empty($_POST["frm_signup_2"])) {
|
||||
$fullname = mysqli_real_escape_string($con, $_POST["fullname"]);
|
||||
$student_id = mysqli_real_escape_string ($con, $_POST["user_student_id"]);
|
||||
$email = mysqli_real_escape_string($con, $_POST["email"]);
|
||||
$password = mysqli_real_escape_string($con, $_POST["password"]);
|
||||
$confirmpassword = mysqli_real_escape_string($con, $_POST["confirmpassword"]);
|
||||
$student_id = $_SESSION['user_student_id'];
|
||||
$passport = $_SESSION['user_passport'];
|
||||
$_SESSION['user_fullname'] = $fullname;
|
||||
$_SESSION['user_type'] = "Student";
|
||||
$_SESSION['user_email'] = $email;
|
||||
|
@ -126,13 +125,12 @@ if (!empty($_POST["frm_signup_2"])) {
|
|||
|
||||
// apply password_hash()
|
||||
$password_hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$sql= "INSERT INTO `users_table`(`Email`, `Password`, `Full_Name`, `UserType`, `Student_ID`, `Passport_Number`) VALUES "
|
||||
. "('$email','$password_hash','$fullname','Student','$student_id','$passport')";
|
||||
$sql= "INSERT INTO `users_table`(`Email`, `Password`, `Full_Name`, `UserType`, `Student_ID`) VALUES "
|
||||
. "('$email','$password_hash','$fullname','Student','$student_id')";
|
||||
|
||||
if ($con->query($sql) === TRUE) {
|
||||
header("Location: Courses.php");
|
||||
} else {
|
||||
// echo "Error: " . $sql . "<br>" . $con->error;
|
||||
echo "Something really bad (SQL insertion error) happend during sign up.";
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +138,6 @@ if (!empty($_POST["frm_signup_2"])) {
|
|||
|
||||
|
||||
|
||||
|
||||
// ################################ LOGIN #####################################
|
||||
|
||||
if (!empty($_POST["frm_login"])) {
|
||||
|
|
Loading…
Reference in New Issue