blob: 51979dadc0d4990eb0be33ba822b495d845bca5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 htmlentities($reason);
exit
}
// TODO: Put pretty HTML here, please
# print full error page
if($heading != NULL)
echo htmlentities($heading);
echo htmlentities($reason);
# exit the script here
exit;
}
|