Update signup redirection to SecurityQuestions.php

Bug48-Aya
Aya Boussouf 2025-05-17 18:38:25 +00:00
parent 8876825ef9
commit a86c810a2d
1 changed files with 8 additions and 1 deletions

View File

@ -177,7 +177,14 @@ if (!empty($_POST["form_signup"])) {
$_SESSION['user_fullname'] =$_SESSION['user_fullname_temp'];
if ($con->query($sql) === TRUE) {
header("Location: Courses.php");
// Get the newly inserted user's ID
$user_id = $con->insert_id;
//Set the user_id in the session
$_SESSION['user_id'] = $user_id;
//Redirect to SecurityQuestions.php
header("Location: SecurityQuestions.php");
} else {
echo "Something really bad (SQL insertion error) happened during sign up.";
}