<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>

<?php

// Application on variables and arrays (The global _SERVER array).
/* Note relative and absolute paths. Relative better (e.g. when move
	the website to another server.
*/


// Below they must be uppercase. Lower: no error but no result.
//----------------------------------------

/* Returns the type of browser or user agent that used to access the current script
*/
echo "<br \><b>HTTP_USER_AGENT:</b> ", $_SERVER['HTTP_USER_AGENT'];

/*
Returns the URL of the referring page
*/
echo "<br \><b>HTTP_REFERER:</b> ", $_SERVER['HTTP_REFERER'];

/*
Returns the URI (script name and arguments appended) from the current URL
*/
echo "<br \><b>REQUEST_URI:</b> ", $_SERVER['REQUEST_URI']; 

/*
Returns the filename of the script relative to the document root
Returns the URI (script name WITHOUT arguments appended) from the current URL.
To see the difference between REQUEST_URI and PHP_SELF,
type ?a=5&b=7 in the browser after the URL.
*/
echo "<br \><b>PHP_SELF:</b> ", $_SERVER['PHP_SELF'];

/*
Returns the full path of the script (including the name of the script)
*/
echo "<br \><b>__FILE__:</b> ", __FILE__;

/*
Returns the IP address of the user requesting the script
*/
echo "<br \><b>REMOTE_ADDR:</b> ", $_SERVER['REMOTE_ADDR']; 

/*
Returns the full path of the website's document root
*/
echo "<br \><b>Document_Root:</b> {$_SERVER['DOCUMENT_ROOT']}";

/*
Returns the name of the web server that is processing the request
*/
echo "<br \><b>SERVER_NAME:</b> ", $_SERVER['SERVER_NAME'];

?>

</BODY>
</HTML>
