blob: c185bd5311ecbd55561847acf2b60b116d2bf15a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<?php
function failure($reason, $httpcode, $ajax = true, $heading = NULL){
# send header with $httpcode
header($_SERVER['SERVER_PROTOCOL'] . " " . $httpcode)
if($ajax){
# just echo the reason to the ajax response
echo htmlentities($reason);
exit
}
// TODO: Put pretty HTML here, please
if($heading != NULL)
echo htmlentities($heading);
echo htmlentities($reason);
# exit the script here
exit;
}
|