summaryrefslogtreecommitdiff
path: root/public_html/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'public_html/functions.php')
-rw-r--r--public_html/functions.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/public_html/functions.php b/public_html/functions.php
new file mode 100644
index 0000000..a5dbd83
--- /dev/null
+++ b/public_html/functions.php
@@ -0,0 +1,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 $reason;
+ exit
+ }
+
+ // TODO: Put pretty HTML here, please
+ if($heading != NULL)
+ echo $heading;
+
+ echo $reason;
+
+ # exit the script here
+ exit;
+}