frontend updates

This commit is contained in:
2023-11-09 01:36:43 +01:00
parent 110ba61112
commit 1bc1f58b8f
28 changed files with 388 additions and 26 deletions

View File

@ -1,8 +1,10 @@
<?php
class Router {
public $returned = false;
public $url = null;
function route($method, $url, $filename) {
$this->url = $url;
$methods = ['GET', 'POST'];
if(in_array($method, $methods)) {
if($_SERVER['REQUEST_METHOD'] == $method) {
@ -15,6 +17,10 @@ class Router {
}
}
function getUrl() {
return $_SERVER['REQUEST_URI'];
}
function __destruct() {
if($_SERVER['REQUEST_METHOD'] == 'GET') {
if(!$this->returned){