]> git.mxchange.org Git - mailer.git/blobdiff - inc/request-functions.php
RevBomb patch applied (thanks to profi-concept)
[mailer.git] / inc / request-functions.php
index b110317396d89a7f79617ae8a9edb9b4fc2acf6e..60a1addea0b10dc328f6b99c73738b245c505260 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Spezialle Funktionen fuer die Anfragebehandlung  *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision:: 856                                                    $ *
+ * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009)              $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author:: stelzi                                                   $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
@@ -94,6 +99,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 +155,29 @@ 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);
+       } elseif (is_array($value)) {
+               // Value is an array so set it directly
+               $_POST[SQL_ESCAPE($element)] = $value;
+       } 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!