aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_html.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions_html.inc.php')
-rw-r--r--include/functions_html.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index c0edf6ed0..74934cbf0 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -627,6 +627,23 @@ function page_forbidden($msg, $alternate_url=null)
}
/**
+ * exits the current script with 400 code
+ * @param string msg a message to display
+ * @param string alternate_url redirect to this url
+ */
+function bad_request($msg, $alternate_url=null)
+{
+ set_status_header(400);
+ if ($alternate_url==null)
+ $alternate_url = make_index_url();
+ redirect_html( $alternate_url,
+ '<div style="text-align:left; margin-left:5em;margin-bottom:5em;">
+<h1 style="text-align:left; font-size:36px;">Bad request</h1><br/>'
+.$msg.'</div>',
+ 5 );
+}
+
+/**
* exits the current script with 404 code when a page cannot be found
* @param string msg a message to display
* @param string alternate_url redirect to this url