Weitere Reviewänderungen

This commit is contained in:
2026-05-31 22:49:13 +02:00
parent 2ce13cef72
commit 5db4ad3e63
2 changed files with 49 additions and 31 deletions
+1 -2
View File
@@ -1,7 +1,6 @@
<?php
$_SESSION = [];
session_destroy();
header("Location: index.php?pfad=login");
header("Location: index.php");
exit();
+27 -8
View File
@@ -1,7 +1,24 @@
<?php
session_start();
ob_start();
$pfad = $_GET["pfad"] ?? "home";
/*
Aktionen wie Logout oder Account löschen müssen vor der HTML-Ausgabe
verarbeitet werden, damit Weiterleitungen mit header() funktionieren.
*/
if ($pfad === "logout") {
include_once "content/logout.php";
exit();
}
if ($pfad === "deleteAccount") {
include_once "content/deleteAccount.php";
exit();
}
?>
<!--
Seite: Index der Lernplattform
Funktion: Webseitengerüst, Anzeigen von Content
@@ -21,26 +38,28 @@ ob_start();
<title>EduForge</title>
</head>
<body>
<?php
include_once 'includes/navbar.php';
//Dynamischer Inhalt:
if (isset($_GET["pfad"])) {
if (file_exists('content/' . $_GET["pfad"] . '.php')) {
include_once 'content/' . $_GET["pfad"] . '.php';
/*
Dynamischer Inhalt:
Je nach pfad-Parameter wird die passende Datei aus content geladen.
*/
if (file_exists('content/' . $pfad . '.php')) {
include_once 'content/' . $pfad . '.php';
} else {
include_once 'content/404.php';
}
} else {
include_once 'content/home.php';
}
include_once 'includes/footer.php';
?>
</body>
</html>
<?php
ob_end_flush();
?>