diff --git a/src/controllers/Register.php b/src/controllers/Register.php index 95d86fd..2fdf8e4 100644 --- a/src/controllers/Register.php +++ b/src/controllers/Register.php @@ -34,6 +34,7 @@ public function __construct() $this->view_data['errors'] = []; $this->view_data['editMode'] = false; $this->view_data['form_submitted'] = false; + $this->view_data['registration_is_successful'] = false; // get list of districts to be displayed on form $this->view_data['districts'] = District::getAll(); @@ -114,11 +115,11 @@ private function handleFormSubmission(): void $success = $client->save(); if ($success) { - Utility::redirect('login'); + $this->view_data['registration_is_successful'] = true; + } else { + (new Error())->handleUnknownError(); + die(); } - - (new Error())->handleUnknownError(); - die(); } else { $this->loadDataToForm($form_data); } diff --git a/src/views/Register.php b/src/views/Register.php index e26a637..c0cef26 100644 --- a/src/views/Register.php +++ b/src/views/Register.php @@ -19,6 +19,7 @@ * @var string $defaultConfirmPassword * @var array $errors list of errors in form after submission * @var District[] $districts list of all district objects + * @var bool $registration_is_successful */ @@ -220,3 +221,17 @@ function togglePasswordVisibility() { } } + +> +
+

Successfully registered! 🎉

+

Thank you for joining Steamy Sips. Your account has been successfully created.

+ +
+
\ No newline at end of file