2 /************************************************************************
3 * MXChange v0.2.1 Start: 02/28/2009 *
4 * =============== Last change: 02/28/2009 *
6 * -------------------------------------------------------------------- *
7 * File : request-functions.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Special functions for request handling *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Spezialle Funktionen fuer die Anfragebehandlung *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // Wrapper for elements in $_GET
41 function REQUEST_GET ($element) {
42 // By default no element is there
45 // Is the element there?
46 if (REQUEST_ISSET_GET($element)) {
48 $value = $_GET[$element];
55 // Checks if an element in $_GET exists
56 function REQUEST_ISSET_GET ($element) {
57 return (isset($_GET['element']));
60 // Removes an element from $_GET
61 function REQUEST_UNSET_GET ($element) {
62 unset($_GET[$element]);
65 // Getter for whole $_GET array
66 function REQUEST_GET_ARRAY () {
70 // Counts entries in $_GET or returns false if not an array
71 function REQUEST_GET_COUNT () {
72 // By default this is not an array
76 $GET = REQUEST_GET_ARRAY();
87 // Wrapper for elements in $_POST
88 function REQUEST_POST ($element) {
89 // By default no element is there
92 // Is the element there?
93 if (REQUEST_ISSET_POST($element)) {
95 $value = $_POST[$element];
102 // Checks if an element in $_POST exists
103 function REQUEST_ISSET_POST ($element) {
104 return (isset($_POST['element']));
107 // Removes an element from $_POST
108 function REQUEST_UNSET_POST ($element) {
109 unset($_POST[$element]);
112 // Getter for whole $_POST array
113 function REQUEST_POST_ARRAY () {
117 // Counts entries in $_POST or returns false if not an array
118 function REQUEST_POST_COUNT () {
119 // By default this is not an array
123 $POST = REQUEST_POST_ARRAY();
126 if (is_array($POST)) {
128 $count = count($POST);
134 // Checks wether a form was sent. If so, the $_POST['ok'] element must be set
135 function IS_FORM_SENT () {
137 return REQUEST_ISSET_POST('ok');