From bcbcc68054fc42df10e36f1e4cec8a9083e4652b Mon Sep 17 00:00:00 2001 From: Alassane Ndoye Date: Sun, 20 Sep 2020 22:07:19 +0000 Subject: [PATCH] ajout fonction http header --- .idea/workspace.xml | 8 ++++---- private/functions.php | 19 +++++++++++++++++-- private/initialize.php | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3a22f25..1ee67e8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -21,7 +21,7 @@ - + @@ -72,6 +71,7 @@ 1600471514586 + 1600486645914 @@ -136,10 +136,10 @@ - + - + diff --git a/private/functions.php b/private/functions.php index 0d965f3..8f356bf 100644 --- a/private/functions.php +++ b/private/functions.php @@ -8,7 +8,7 @@ function url_for($script_path) { return WWW_ROOT . $script_path; } -/*function u($string="") { +function u($string="") { return urlencode($string); } @@ -18,7 +18,7 @@ function raw_u($string="") { function h($string="") { return htmlspecialchars($string); -}*/ +} function getGUID(){ if (function_exists('com_create_guid')){ return com_create_guid(); @@ -35,4 +35,19 @@ function getGUID(){ return $uuid; } } + +function error_404(){ + header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found"); + exit(); +} + +function error_500(){ + header($_SERVER["SERVER_PROTOCOL"] . " 500 Internal Server Error"); + exit(); +} + +function redirect_to($location){ + header("Location: " . $location); + exit(); +} ?> diff --git a/private/initialize.php b/private/initialize.php index f43f12f..7ae3dcf 100644 --- a/private/initialize.php +++ b/private/initialize.php @@ -1,5 +1,5 @@