diff options
Diffstat (limited to 'bootstrap/functions.php')
| -rw-r--r-- | bootstrap/functions.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bootstrap/functions.php b/bootstrap/functions.php new file mode 100644 index 0000000..8c998fc --- /dev/null +++ b/bootstrap/functions.php @@ -0,0 +1,24 @@ +<?php + +function failure($reason, $httpcode, $ajax = true, $heading = NULL){ + + # send header with $httpcode + header($_SERVER['SERVER_PROTOCOL'] . " " . $httpcode); + + # just echo the reason to the ajax response + if($ajax){ + echo $reason; + exit; + } + + // TODO: Put pretty HTML here, please + + # print full error page + if($heading != NULL) + echo $heading; + + echo $reason; + + # exit the script here + exit; +} |
