diff --git a/index.php b/index.php index c9a5cfb..e5dbec3 100644 --- a/index.php +++ b/index.php @@ -2,99 +2,51 @@ if (session_status() === PHP_SESSION_NONE) { session_start(); } -ob_start(); -include_once("php/controller/index.php"); -$pfad = $_GET["pfad"] ?? "home"; +include_once("php/controller/index-controller.php"); -/* - Controller für Aktionen werden vor der HTML-Ausgabe geladen, - damit Weiterleitungen mit header() funktionieren. -*/ -if ($pfad === "login") { - include_once "php/controller/login-controller.php"; -} - -if ($pfad === "register") { - include_once "php/controller/register-controller.php"; -} -if ($pfad === "password-forgotten") { -include_once "php/controller/password-forgotten-controller.php"; -} - -if ($pfad === "confirm-register") { - include_once "php/controller/confirm-register-controller.php"; -} - -if ($pfad === "confirm-password") { - include_once "php/controller/confirm-password-controller.php"; -} - -if ($pfad === "logout") { - include_once "php/controller/logout-controller.php"; - exit(); -} - -if ($pfad === "deleteAccount") { - include_once "php/controller/deleteAccount-controller.php"; - exit(); -} ?> + + + + + + + + - - - + + + + + + + + + - - - - - - + + + + + - - - - - - - - - - - - - - - - - EduForge - - - - - - - - + EduForge + + \ No newline at end of file +include_once 'includes/navbar.php'; + +// Dynamischer Inhalt (Absolut sicher durch die obige Prüfung) +if (isset($pfad) && $pfad !== "404" && file_exists('content/' . $pfad . '.php')) { + include_once 'content/' . $pfad . '.php'; +} else { + include_once 'content/404.php'; +} + +include_once 'includes/footer.php'; +?> + + +