Anpassung der index.php damit der richtige controller geladen wird

This commit is contained in:
rirat-0
2026-06-02 13:20:54 +02:00
parent 36276c7c88
commit f04d8fecd3
2 changed files with 8 additions and 3 deletions
+8 -1
View File
@@ -36,7 +36,14 @@ require_once $abs_path . "/php/controller/index-controller.php";
include_once 'includes/navbar.php';
//Dynamischer Inhalt:
if (isset($_GET["pfad"])) {
if (file_exists($abs_path . '/content/' . $_GET["pfad"] . '.php')) {
if ($_GET["pfad"] === "search-results") {
if (file_exists($abs_path . '/php/controller/search-results-controller.php')) {
include_once $abs_path . '/php/controller/search-results-controller.php';
}
}
if (file_exists($abs_path . '/content/' . $_GET["pfad"] . '.php')) {
include_once $abs_path . '/content/' . $_GET["pfad"] . '.php';
} else {
include_once $abs_path . '/content/404.php';
@@ -22,8 +22,6 @@ if ($_SERVER["REQUEST_METHOD"] === "GET" && isset($_GET["q"])) {
$_SESSION["message"] = "internal_error";
}
}
header("location: ../../index.php?pfad=search-results");
exit();
}