From 28f7af8536e18a5e7ab7a7ab0c8bb933c16c6b30 Mon Sep 17 00:00:00 2001 From: bruno Date: Tue, 6 Feb 2024 16:34:53 +0100 Subject: [PATCH] test --- index.php | 4 +++- lib/router.php | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index f02e17a..e89a52e 100644 --- a/index.php +++ b/index.php @@ -18,8 +18,10 @@ if (!isLoggedIn()) { setDefaultSessionData(); } +print_r($routerRequest); + if ($routerRequest["type"] == "api") { - echo getEndpoint($routerRequest["page_name"]); + echo getEndpoint($routerRequest["site_name"]); } elseif ($routerRequest["type"] == "page") { echo getPage($routerRequest["site_name"], $routerRequest["page_name"]); diff --git a/lib/router.php b/lib/router.php index 726f28b..0b704be 100644 --- a/lib/router.php +++ b/lib/router.php @@ -10,10 +10,7 @@ function initRouter(): array $request_uri = explode("/", $_SERVER["QUERY_STRING"]); - echo $_SERVER["QUERY_STRING"]; - print_r($request_uri); $request_uri = array_slice($request_uri, -3, 3); - print_r($request_uri); $routerRequest["site_name"] = basename($request_uri[1]); $routerRequest["page_name"] = basename($request_uri[2]);