Only allow GET and POST HTTP request and die otherwise.
[Project_webapp.git] / lib / utils.php
index e6e0365a410f6c45f460e2c455a1026623f6d678..d937db729cb9f78b9bd54109c811136289de9e18 100644 (file)
@@ -1,9 +1,17 @@
 <?php
-function isPostRequest() {
+function is_post_request() {
     if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST') {
         return true;
     } else {
         return false;
     }
 }
+
+function is_get_request() {
+    if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'GET') {
+        return true;
+    } else {
+        return false;
+    }
+}
 ?>