From 09f403582c5de5dcc97b265e8ae42469c9c8ff3f Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 27 Jun 2017 01:43:16 -0400 Subject: Add function input() --- app/class/globals.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/class/globals.php b/app/class/globals.php index 94df716..776fc35 100644 --- a/app/class/globals.php +++ b/app/class/globals.php @@ -87,6 +87,17 @@ function isAction(string $action) : bool return $_REQUEST['action'] == $action; } +/* + * Get an array of submitted form input + */ +function input() : array +{ + if (!isset($_REQUEST['input'])) + throw new Exception("Requested form input, but no input data was supplied"); + + return $_REQUEST['input']; +} + /* * Check for errors, warnings, or notices */ -- cgit v1.2.3