X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fhtml%2FHttpRequest.class.php;h=2eb26f0a7cf1664876061d1df3344457e6f807ee;hb=75a1eedb8977b8f2db459128bab9aaf367e3b58b;hp=cea6122619c391f01cc5a51f9db52d69ae6fbcf3;hpb=b4b57ea6a41c263250715f72248d48eae22f5476;p=timetracker.git diff --git a/WEB-INF/lib/html/HttpRequest.class.php b/WEB-INF/lib/html/HttpRequest.class.php index cea61226..2eb26f0a 100644 --- a/WEB-INF/lib/html/HttpRequest.class.php +++ b/WEB-INF/lib/html/HttpRequest.class.php @@ -32,22 +32,27 @@ class ttHttpRequest { return isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : false; } - // The isPost function determines if a request method is POST. + // The isGet function determines if a request method is a GET. + function isGet() { + return ($this->getMethod() == 'GET'); + } + + // The isPost function determines if a request method is a POST. function isPost() { return ($this->getMethod() == 'POST'); } - // The getParameter is the primary function of this class. It returns request parameter, + // The getParameter is the primary function of this class. It returns request parameter // identified by $name. - function getParameter($name = "", $default = null) { + function getParameter($name = '', $default = null) { switch ($this->getMethod()) { case 'GET': - if (isset($_GET[$name]) && ($_GET[$name] != "")) + if (isset($_GET[$name]) && ($_GET[$name] != '')) return $_GET[$name]; case 'POST': - if (isset($_POST[$name]) && ($_POST[$name] != "")) + if (isset($_POST[$name]) && ($_POST[$name] != '')) return $_POST[$name]; } return $default;