From 07f5140771388c9e0c8a99b0dd2e5d950bdb173b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 14 Oct 2021 15:16:42 +1100 Subject: moving h-source subdir out. --- admin/Library/Request.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 admin/Library/Request.php (limited to 'admin/Library/Request.php') diff --git a/admin/Library/Request.php b/admin/Library/Request.php new file mode 100644 index 0000000..12bf16c --- /dev/null +++ b/admin/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