debug print

This commit is contained in:
Bruno Rybársky 2024-02-02 15:53:32 +01:00
parent c0fbaec15a
commit 4eff9ddb73
2 changed files with 13 additions and 12 deletions

@ -43,6 +43,7 @@ function getPage($page_name = null): array|false|string
$dynamic_page_file = $routerConfig["page_dir"] . $routerRequest["subdomain"] . "/" . $page_name . ".php";
$page_file = $routerConfig["page_dir"] . $routerRequest["subdomain"] . "/" . $page_name . ".html";
echo $page_file;
$skeleton = file_get_contents($routerConfig["template_dir"] . "skeleton.html");
$nav = file_get_contents($routerConfig["template_dir"] . "nav.html");

@ -16,19 +16,19 @@ function initRouter(): bool
$routerRequest["domain"] = basename($routerRequest["requestAddress"][0]);
$routerRequest["tld"] = basename($routerRequest["requestAddress"][1]);
} else {
$routerRequest["subdomain"] = basename($routerRequest["requestAddress"][0]);
$routerRequest["domain"] = basename($routerRequest["requestAddress"][1]);
$routerRequest["tld"] = basename($routerRequest["requestAddress"][2]);
$routerRequest["page_name"] = basename($_SERVER["QUERY_STRING"]);
if (empty($routerRequest["page_name"])) {
// Page name is empty
$needsRedirect = true;
$routerRequest["page_name"] = $routerConfig["default_page"];
}
}
$routerRequest["subdomain"] = basename($routerRequest["requestAddress"][0]);
$routerRequest["domain"] = basename($routerRequest["requestAddress"][1]);
$routerRequest["tld"] = basename($routerRequest["requestAddress"][2]);
$routerRequest["page_name"] = basename($_SERVER["QUERY_STRING"]);
if (empty($routerRequest["page_name"])) {
// Page name is empty
$needsRedirect = true;
$routerRequest["page_name"] = $routerConfig["default_page"];
}
if ($needsRedirect) {
$redirectAddress = $routerConfig["protocol"] .