mail func added, post route added, more css

This commit is contained in:
2023-04-13 17:39:50 +02:00
parent b7721daa00
commit 8065ab134d
6 changed files with 99 additions and 12 deletions

View File

@ -2,12 +2,15 @@
class Router {
public $returned = false;
function route($url, $filename) {
if($_SERVER['REQUEST_METHOD'] == 'GET') {
if ($_SERVER['REQUEST_URI'] == $url) {
require_once("./pages/$filename/$filename.php");
$this->returned = true;
return;
function route($method, $url, $filename) {
$methods = ['GET', 'POST'];
if(in_array($method, $methods)) {
if($_SERVER['REQUEST_METHOD'] == $method) {
if ($_SERVER['REQUEST_URI'] == $url) {
require_once("./pages/$filename/$filename.php");
$this->returned = true;
return;
}
}
}
}