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

search for in the

$_SESSION> <$_FILES
Last updated: Fri, 27 Jun 2008

view this page in

$_REQUEST

(No version information available, might be only in CVS)

$_REQUEST — HTTP 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ă: Variables provided to the script via the GET, POST, and COOKIE input mechanisms, and which therefore cannot be trusted. The presence and order of variable inclusion in this array is defined according to the PHP variables_order configuration directive.



add a note add a note User Contributed Notes
$_REQUEST
not at important dot dig
08-Jun-2008 09:39
That would depend on your server configuration.
not at telling dot org
22-May-2008 04:05
POST has priority over GET.

If you POST and GET the same variable with different values, the POST value will be the one used in the REQUEST variable.

EX:
<?PHP
if(isset($_GET['posted']) == 1)
{
    echo
"POST: ";
   
print_R($_POST);
    echo
"<br/>GET: ";
   
print_R($_GET);
    echo
"<br/>REQUEST: ";
   
print_R($_REQUEST);
}
else
{
   
?>
    <form method="post" action="?posted=1&something=someotherval">
        <input type="text" value="someval" name="something"/>
        <input type="submit" value="Click"/>
    </form>
    <?
}
?>

The above form post will result in the following output:

POST: Array ( [something] => someval )
GET: Array ( [posted] => 1 [something] => someotherval )
REQUEST: Array ( [posted] => 1 [something] => someval )

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