aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/functions.php
blob: 8c998fc296774a12674c982e6c4b85795f5a48ea (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 $reason;
		exit;
	}

	// TODO: Put pretty HTML here, please

	# print full error page
	if($heading != NULL)
		echo $heading;

	echo $reason;

	# exit the script here
	exit;
}