The $_SERVER superglobal contains useful information about the web server.
As for any other superglobal, you can print out its content using print_r() and <pre>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<?php //displaying $_SERVER content echo "<pre>"; print_r($_SERVER); echo "</pre>"; /* Array ( [DB_USER] => *** [DB_PASS] => *** [HTTP_HOST] => localhost:8888 [HTTP_USER_AGENT] => Mozilla/5.0 ... [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;**** [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_CONNECTION] => .... [HTTP_COOKIE] => PHPSESSID=*** [PATH] => .... [SERVER_SIGNATURE] => Apache/2.0.63 (Unix) PHP/5.3.2 ... [SERVER_SOFTWARE] => Apache/2.0.63 (Unix) PHP/5.3.2 ... [SERVER_NAME] => localhost [SERVER_ADDR] => *** [SERVER_PORT] => 8888 [REMOTE_ADDR] => *** [DOCUMENT_ROOT] => /Applications/MAMP/htdocs [SERVER_ADMIN] => you@example.com [SCRIPT_FILENAME] => /Applications/MAMP/htdocs/STUDIO/PHP/tests.php [REMOTE_PORT] => *** [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => [REQUEST_URI] => /STUDIO/PHP/tests.php [SCRIPT_NAME] => /STUDIO/PHP/tests.php [PHP_SELF] => /STUDIO/PHP/tests.php [REQUEST_TIME] => ... ) */ ?> |