diff --git a/index.php b/index.php index 1622627ea4eab3632858c5b27f5ebeefec5c77b0..1b43c9456a6c9c4fa80e37049d711e110ae39e7e 100644 --- a/index.php +++ b/index.php @@ -5,7 +5,7 @@ require_once('core/_inc.php'); /* require_once('config/bddConnect.php'); */ // Vérifie le type de connexion -if(isset($_SERVER['HTTPS'])) $http = "https"; else $http = "http"; +if (isset($_SERVER['HTTPS'])) $http = "https"; else $http = "http"; // Variables permettant la gestion des pages à afficher $url = parse_url("$http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); @@ -14,14 +14,14 @@ $urlPath = explode("/", $url["path"]); array_shift($urlPath); // Si l'url commence par /Cristo -> Dev de Mathieu -if(substr($_SERVER["REQUEST_URI"], 0, 7) == "/Cristo"){ - $websiteBaseUrl = $http."://".$_SERVER["HTTP_HOST"]."/Cristo"; +if (substr($_SERVER["REQUEST_URI"], 0, 7) == "/Cristo") { + $websiteBaseUrl = $http . "://" . $_SERVER["HTTP_HOST"] . "/Cristo"; array_shift($urlPath); } else { - $websiteBaseUrl = $http."://".$_SERVER["HTTP_HOST"]; + $websiteBaseUrl = $http . "://" . $_SERVER["HTTP_HOST"]; } -if(!empty($urlPath[0])){ +if (!empty($urlPath[0])) { match ($urlPath[0]) { "rechercher" => require_once('pages/rechercher.php'), "recette" => require_once('pages/recette.php'),