Home >>PHP Tutorial >PHP Super global variables
PHP super global variable is used to access global variables from anywhere in the PHP script. PHP Super global variables is accessible inside the same page that defines it, as well as outside the page. while local variable's scope is within the page that defines it.
It is used to collect value from a form(HTML script) sent with method='get'. information sent from a form with the method='get' is visible to everyone(it display on the browser URL bar).
It is used to collect value in a form with method="post". Information sent from a form is invisible to others.(can check on address bar)
This can be used to collect data with both post and get method.
: It can be used to upload files from a client computer/system to a server. OR
: Such as File Name, File Type, File Size, File temporary name.
A session variable is used to store information about a single user, and are available to all pages within one application.
A cookie is used to identify a user. cookie is a small file that the server embedded on user computer.
$_SERVER holds information about headers, paths, and script locations.
Eg
$_SERVER["SERVER_PORT"]
$_SERVER["SERVER_NAME"]
$_SERVER["REQUEST_URI"]