PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

$_SESSION> <$_FILES
Last updated: Fri, 28 Nov 2008

view this page in

$_REQUEST

$_REQUESTHTTP Request variables

Descrierea

An associative array that by default contains the contents of $_GET, $_POST şi $_COOKIE.

Istoria schimbărilor

Versiunea Descriere
5.3.0 Introduced request_order. This directive affects the contents of $_REQUEST.
4.3.0 $_FILES information was removed from $_REQUEST.
4.1.0 Introduced $_REQUEST.

Note

Notă: Aceasta este o variabilă 'superglobală', sau globală automată. Aceasta pur şi simplu înseamnă că ea este disponibilă în toate circumstanţele pe parcursul script-ului. Nu este nevoie de a scrie global $variable; pentru a o accesa din funcţii sau metode.

Notă: When running on the command line , this will not include the argv and argc entries; these are present in the $_SERVER array.

Notă: The variables in $_REQUEST are provided to the script via the GET, POST, and COOKIE input mechanisms and therefore could be modified by the remote user and cannot be trusted. The presence and order of variables listed in this array is defined according to the PHP variables_order configuration directive.



add a note add a note User Contributed Notes
$_REQUEST
strata_ranger at hotmail dot com
17-Jul-2008 06:04
Don't forget, because $_REQUEST is a different variable than $_GET and $_POST, it is treated as such in PHP -- modifying $_GET or $_POST elements at runtime will not affect the ellements in $_REQUEST, nor vice versa.

e.g:

<?php

$_GET
['foo'] = 'a';
$_POST['bar'] = 'b';
var_dump($_GET); // Element 'foo' is string(1) "a"
var_dump($_POST); // Element 'bar' is string(1) "b"
var_dump($_REQUEST); // Does not contain elements 'foo' or 'bar'

?>

If you want to evaluate $_GET and $_POST variables by a single token without including $_COOKIE in the mix, use  $_SERVER['REQUEST_METHOD'] to identify the method used and set up a switch block accordingly, e.g:

<?php

switch($_SERVER['REQUEST_METHOD'])
{
case
'GET': $the_request = &$_GET; break;
case
'POST': $the_request = &$_POST; break;
.
.
// Etc.
.
default:
}
?>
not at important dot dig
08-Jun-2008 10:39
That would depend on your server configuration.

$_SESSION> <$_FILES
Last updated: Fri, 28 Nov 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites