Subscribe to Tutorial Feed

Flash and PHP Bible

The Flash and PHP Bible has been released! The book can be found on Amazon or wherever fine books are sold in your area.

The Flash and PHP Bible has a forum for quick support.

Scriptplayground » tutorials » php » Predefined Variables

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).

Follow Scriptplayground on Twitter (@scriptplay)

Comments: Predefined Variables

 mik  Tue Aug 30, 2005 4:58 pm  
Very helpful
 Brendan  Mon Sep 5, 2005 7:36 pm  
Would it be possible for you to put this into a table instead of all the code blocks... the page is really hard to look at...
 Brendan-reply  Mon Feb 25, 2008 12:32 am  
Brendan, thats true! mkeefe we are waiting!!!
Add a comment
The ability to add new comments has been disabled in this archived version.

Loading
Main | Tutorials | Articles