Scriptplayground

 Print Page | Close Window

Predefined Variables

From PHP.net, since they already explained it so well.

$GLOBALS

Contains a reference to every variable which is currently available within the global scope of the script. The keys of this array are the names of the global variables. $GLOBALS has existed since PHP 3.



$_SERVER

Variables set by the web server or otherwise directly related to the execution environment of the current script. Analogous to the old $HTTP_SERVER_VARS array (which is still available, but deprecated).



$_GET

Variables provided to the script via HTTP GET



$_POST

Variables provided to the script via HTTP POST



$_COOKIE

Variables provided to the script via HTTP cookies.



$_FILES

Variables provided to the script via HTTP post file uploads.



$_ENV

Variables provided to the script via the environment. Analogous to the old $HTTP_ENV_VARS array (which is still available, but deprecated).



$_REQUEST

Variables provided to the script via the GET, POST, and COOKIE input mechanisms, and which therefore cannot be trusted.



$_SESSION

Variables which are currently registered to a script's session. Analogous to the old $HTTP_SESSION_VARS array



For more in depth information, please visit php.net (a really great PHP resource site).


Find this article at:
http://scriptplayground.com/tutorials/php/Predefined-Variables/