From 232aa1924c8c0f10d87b210b46c9f061af5c844c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 17 Oct 2010 13:29:57 +0000 Subject: added files --- h-source/Library/Request.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 h-source/Library/Request.php (limited to 'h-source/Library/Request.php') diff --git a/h-source/Library/Request.php b/h-source/Library/Request.php new file mode 100644 index 0000000..12bf16c --- /dev/null +++ b/h-source/Library/Request.php @@ -0,0 +1,39 @@ +'.__METHOD__.': function '.$func. ' does not exists'); + } + return isset($_GET[$name]) ? call_user_func($func,$_GET[$name]) : $default; + } + + public function post($name, $default = null, $func = 'none') + { + if (!function_exists($func)) + { + throw new Exception('Error in '.__METHOD__.': function '.$func. ' does not exists'); + } + return isset($_POST[$name]) ? call_user_func($func,$_POST[$name]) : $default; + } + + public function cookie($name, $default = null, $func = 'none') + { + if (!function_exists($func)) + { + throw new Exception('Error in '.__METHOD__.': function '.$func. ' does not exists'); + } + return isset($_COOKIE[$name]) ? call_user_func($func,$_COOKIE[$name]) : $default; + } + +} \ No newline at end of file -- cgit v1.2.3