summaryrefslogtreecommitdiffstats
path: root/inc/request.inc.php
diff options
context:
space:
mode:
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';
+ }
}