From a86c810a2dc5fd9274ea86ef73b3c6855194973d Mon Sep 17 00:00:00 2001 From: Aya Boussouf Date: Sat, 17 May 2025 18:38:25 +0000 Subject: [PATCH] Update signup redirection to SecurityQuestions.php --- Script.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Script.php b/Script.php index ac92828..60c8a04 100644 --- a/Script.php +++ b/Script.php @@ -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."; }