Skip to content

Commit

Permalink
ajout fonction http header
Browse files Browse the repository at this point in the history
  • Loading branch information
aloundoye committed Sep 20, 2020
1 parent 007e939 commit bcbcc68
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions private/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function url_for($script_path) {
return WWW_ROOT . $script_path;
}

/*function u($string="") {
function u($string="") {
return urlencode($string);
}

Expand All @@ -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();
Expand All @@ -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();
}
?>
2 changes: 1 addition & 1 deletion private/initialize.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

ob_start(); //output buffering is turned on
// Assign file paths to PHP constants
// __FILE__ returns the current path to this file
// dirname() returns the path to the parent directory
Expand Down

0 comments on commit bcbcc68

Please sign in to comment.