PHP code to $_server variables list with details
Posted On at by milanHere are some more php $_SERVER variables which will give lots of useful information as mentioned below
$_SERVER['PHP_SELF']
This will give the file name of current script being executed, even if its included file it will give its file name.
$_SERVER['GATEWAY_INTERFACE']
Used to get the revision of the CGI specification being used on the serveri.e. 'CGI/1.1'.
$_SERVER['SERVER_ADDR']
Get the IP address of the server on which script is being execute.
$_SERVER['SERVER_NAME']
Get the Host name of server under which script is being executed.
$_SERVER['REMOTE_HOST']
Get the Host name of the visitor.
$_SERVER['REMOTE_PORT']
Get the communication port of the visitor for current communication.
$_SERVER['SERVER_PORT']
Get the communication port of the server for current communication.
$_SERVER['REQUEST_URI']
Get the URI which was entered to access current page (e.g. /contact.php)