A lot fixes to templates and missing functions added, more rewrites
[mailer.git] / inc / request-functions.php
index b110317396d89a7f79617ae8a9edb9b4fc2acf6e..740f7bd52eea4aeedb9fbe6e1b3f2521930b276f 100644 (file)
@@ -94,6 +94,11 @@ function REQUEST_GET_COUNT () {
        // Return value
 }
 
+// Setter for element in $_GET
+function REQUEST_SET_GET ($element, $value) {
+       $_GET[SQL_ESCAPE($element)] = SQL_ESCAPE($value);
+}
+
 // Wrapper for elements in $_POST
 function REQUEST_POST ($element) {
        // By default no element is there
@@ -145,6 +150,26 @@ function REQUEST_POST_COUNT () {
        // Return value
 }
 
+// Setter for element in $_POST
+function REQUEST_SET_POST ($element, $value) {
+       if (is_array($element)) {
+               // Set array
+               $eval = "\$_POST['";
+
+               // Add all entries
+               $eval .= implode("', '", $element);
+
+               // Finish eval() command
+               $eval .= sprintf("'] = \"%s\";", SQL_ESCAPE($value));
+
+               // And run it
+               eval($eval);
+       } else {
+               // Set regular entry
+               $_POST[SQL_ESCAPE($element)] = SQL_ESCAPE($value);
+       }
+}
+
 // Checks wether a form was sent. If so, the $_POST['ok'] element must be set
 function IS_FORM_SENT () {
        // Simply wrap it!