byecorps.com/index.php
bye 6873a59d19 Multiple changes
+ Make the TV at the bottom have a random chance to show the trans flag
+ Homepage shows an ad for ByeCorps stuff
2024-06-06 15:25:23 +01:00

47 lines
838 B
PHP

<?php
$uri_string = $_SERVER['REQUEST_URI'];
$query_string = explode('?', $uri_string);
if(isset($query_string[1])) {
$uri_string = $query_string[0];
$query_string = explode('&', $query_string[1]);
$query = array();
foreach($query_string as $string) {
$bits = explode('=', $string);
$query[$bits[0]] = $bits[1];
}
$path = $query['path'] ?? null;
}
else {
$path = null;
$query = array();
}
if (is_null($path)) {
$path = $query_string[0];
}
if (str_ends_with($path, "/")) {
$path = rtrim($path, "/");
}
$pages = [
"" => "home.php",
"/credits" => "credits.php",
"/blog" => "blog/blog.html"
];
include ("header.html");
if (isset($pages[$path])) {
include ($pages[$path]);
} else {
http_response_code(404);
include "404.html";
}
include ("footer.php");