]> git.mxchange.org Git - mailer.git/blobdiff - inc/request-functions.php
CSS cleanup, jquery updated:
[mailer.git] / inc / request-functions.php
index a3bd5e3966db704757664c07209c7fc97e8c4708..d7817ba0c921108d059409c33ac75941c3a28cd2 100644 (file)
@@ -117,7 +117,7 @@ function setGetRequestElement ($element, $value) {
 }
 
 // Wrapper for elements in $_POST
-function postRequestElement ($element, $subElement=null) {
+function postRequestElement ($element, $subElement = NULL) {
        // By default no element is there
        $value = NULL;
 
@@ -125,6 +125,7 @@ function postRequestElement ($element, $subElement=null) {
        if (isset($GLOBALS['cache_request']['post'][$element][$subElement])) {
                // Then use it
                $value = $GLOBALS['cache_request']['post'][$element][$subElement];
+               //* DEBUG: */ print $element.'/'.$subElement.'='.$value.'<br />';
        } elseif (isPostRequestElementSet($element)) {
                // Then use it
                $value = $GLOBALS['raw_request']['post'][$element];
@@ -133,12 +134,16 @@ function postRequestElement ($element, $subElement=null) {
                if ((!is_null($subElement)) && (isPostRequestElementSet($element, $subElement))) {
                        // Then use this
                        $value = SQL_ESCAPE($value[$subElement]);
+                       //* DEBUG: */ print 'sub!<br />';
                } elseif (!is_array($value)) {
                        // Escape it here
                        $value = SQL_ESCAPE($value);
+                       //* DEBUG: */ print 'no-array!<br />';
                }
 
                // Set it in cache
+               //* DEBUG: */ print $element.'/'.$subElement.'='.$value.'<br />';
+               //* DEBUG: */ print('<pre>'.print_r($_POST,true).'</pre>');
                $GLOBALS['cache_request']['post'][$element][$subElement] = $value;
        } // END - if
 
@@ -147,7 +152,7 @@ function postRequestElement ($element, $subElement=null) {
 }
 
 // Checks if an element in $_POST exists
-function isPostRequestElementSet ($element, $subElement=null) {
+function isPostRequestElementSet ($element, $subElement = NULL) {
        if (is_null($subElement)) {
                return ((isset($GLOBALS['raw_request']['post'][$element])) && (('' . $GLOBALS['raw_request']['post'][$element] . '') != ''));
        } else {
@@ -247,5 +252,23 @@ function getRequestUri () {
        return $_SERVER['REQUEST_URI'];
 }
 
+// Add all GET parameters to a string (without leading sign)
+function addAllGetRequestParameters () {
+       // Init variable
+       $return = '';
+
+       // Now add all parameters
+       foreach (getRequestArray() as $key => $value) {
+               // Add it secured
+               $return .= SQL_ESCAPE($key) . '=' . SQL_ESCAPE($value) . '&amp;';
+       } // END - foreach
+
+       // Remove trailing &amp;
+       $return = substr($return, 0, -5);
+
+       // Return it
+       return $return;
+}
+
 // [EOF]
 ?>