From cab4355fec9928639e688d096d9ad5e77cb28493 Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Fri, 10 Jun 2016 17:19:50 +0200 Subject: first rough version of exams-module. --- inc/request.inc.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'inc/request.inc.php') 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'; + } } -- cgit v1.2.3-55-g7522