superglobals Flashcards
$GLOBALS
All variables that are currently defined in the global scope of the script. The variable names are the keys of the array.
$_SERVER
Information such as headers, paths, and script locations. The entries in this array are created by the web server and there is no guarantee that every web server will provide any or all of these.
$_GET
Variables passed to the current script via the HTTP GET method.
$_POST
Variables passed to the current script via the HTTP POST method.
$_FILES
Items uploaded to the current script via the HTTP POST method.
$_COOKIE
Variables passed to the current script via HTTP cookies.
$_SESSION
Session variables available to the current script.
$_REQUEST
Contents of information passed from the browser; by default, $_GET, $_POST, and $_COOKIE.
$_ENV
Variables passed to the current script via the environment method.
htmlentities
converts all characters into HTML entities. To access $_SERVER for example the syntax is:
$came_from = htmlentites($_SERVER[‘HTTP_REFERER’]);