Pages

php super global variables examples | super global variables in php example

Friday, 26 April 2013




Super global variables are special type variables in php. We can access them from any place with in the application.

$_GET:-The $_GET is a super global variable. By using this super global variable we can get the posted values of GET method. $_GET super global variable by default, is the only way that we can access variables passed via GET method.

$_POST:-The $_POST is a super global variable. By using this super global variable we can get the posted values of POST method. When ever we can submit the form get are post method to get the form values $_REQUEST.

$_SESSION:  $_SESSION is a super global variable. By using this super global variable we can create a SESSION and we read the SESSION.SESSION are used to maintain the state of the application.

$_COOKIE: $_COOKIE is a super global variable. By using this is super global variable stores information passed into the script through HTTP cookies.

$_ENV: $_ENV is a super global variable. By using this super global variable we can get the information of environmental variable environmental variables are nothing but OS variable.

$_FILES:$_FILE is a super global variable. By using this super global variable we can get the uploaded file information

$_REQUEST: $_REQUEST is a super global variable. We can get the values of both GET and POST methods and also query string and cookie values.

$_SERVER: $_SERVER is a super global variable. We can get the information of server. It is providing number of elements.

$_SERVER[SERVER_S/W]
$_SERVER[SERVER_NAME]
$_SERVER[SERVER_ADDR]
$_SERVER[SERVER_PORT]
$_SERVER[REMOTE_ADDER]
$_SERVER[DOCUMENT_ROOT]
$_SERVER[QUERY_STRING]

 

Most Reading