debug print
This commit is contained in:
parent
c0fbaec15a
commit
4eff9ddb73
@ -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"] .
|
||||
|
Loading…
Reference in New Issue
Block a user