// By default no element is there
$value = null;
- // Is the element there?
- if (REQUEST_ISSET_GET($element)) {
- // Then use it
- $value = $_GET[$element];
+ // Is the element cached or there?
+ if (isset($GLOBALS['cache_array']['request_get'][$element])) {
+ // Then use the cache
+ $value = $GLOBALS['cache_array']['request_get'][$element];
+ } elseif (REQUEST_ISSET_GET($element)) {
+ // Then get it directly
+ $value = SQL_ESCAPE($_GET[$element]);
+
+ // Store it in cache
+ $GLOBALS['cache_array']['request_get'][$element] = $value;
} // END - if
// Return value
}
// Checks if an element in $_GET exists
-function REQUEST_ISSET_GET ($element) {
- return (isset($_GET['element']));
+function REQUEST_ISSET_GET ($element, $extra="") {
+ if (empty($extra)) {
+ return (isset($_GET[$element]));
+ } else {
+ return (isset($_GET[$element][$extra]));
+ }
}
// Removes an element from $_GET
// 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
}
// Checks if an element in $_POST exists
-function REQUEST_ISSET_POST ($element) {
- return (isset($_POST['element']));
+function REQUEST_ISSET_POST ($element, $extra="") {
+ if (empty($extra)) {
+ return (isset($_POST[$element]));
+ } else {
+ return (isset($_POST[$element][$extra]));
+ }
}
// Removes an element from $_POST
// 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!