summaryrefslogtreecommitdiffstats
path: root/inc/request.inc.php
diff options
context:
space:
mode:
authorChristian Klinger2016-06-10 17:19:50 +0200
committerChristian Klinger2016-06-10 17:19:50 +0200
commitcab4355fec9928639e688d096d9ad5e77cb28493 (patch)
tree79aa7dc308c4c877bef87f89cf2b88fbe917ef74 /inc/request.inc.php
parentuse Module:: instead of require (diff)
downloadslx-admin-cab4355fec9928639e688d096d9ad5e77cb28493.tar.gz
slx-admin-cab4355fec9928639e688d096d9ad5e77cb28493.tar.xz
slx-admin-cab4355fec9928639e688d096d9ad5e77cb28493.zip
first rough version of exams-module.
Diffstat (limited to 'inc/request.inc.php')
-rw-r--r--inc/request.inc.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/request.inc.php b/inc/request.inc.php
index f46210af..0052fb24 100644
--- a/inc/request.inc.php
+++ b/inc/request.inc.php
@@ -45,5 +45,18 @@ class Request
if ($type !== false) settype($_REQUEST[$key], $type);
return $_REQUEST[$key];
}
-
+
+ /**
+ * @return true iff the request is a GET request
+ */
+ public static function isPost() {
+ return $_SERVER['REQUEST_METHOD'] == 'POST';
+ }
+
+ /**
+ * @return true iff the request is a POST request
+ */
+ public static function isGet() {
+ return $_SERVER['REQUEST_METHOD'] == 'GET';
+ }
}