PHP provides some information which is available in any PHP script. You should be aware of local and global variables how they are available inside single functions or single pages. PHP reserved variables (the proper name) are better known as super globals. They are not set by the script but by the server.
$_SERVER
This is the only one which you might find interesting immediately.
$_SERVER is an associative array which holds information such as:
- the name of the current page and it's location on the server $_SERVER["PHP_SELF"]
- the IP address of the server $_SERVER["SERVER_ADDR"]
- the name of the server $_SERVER["SERVER_NAME"]
- the IP address of the person viewing the page $_SERVER["REMOTE_ADDR"]
- the browser the user is using $_SERVER["HTTP_USER_AGENT"]
There are plenty more so create a page which uses PRE tags and PRINT_R to output the whole $_SERVER array.
As with any associative array you can get at the contents like this:
$ip=$_SERVER["REMOTE_ADDR"];
$_GET and $_POST
You will learn about these in more detail soon. They are two ways to transfer data from one Web page to another. $_GET and $_POST will only contain something if you have put it there. $_POST is normally used to hold HTML form data. $_GET can do that but is normally for making more flexible links.
$_FILES
This super global variable contains a list of all files uploaded by a Web page to the server. As that is normally no files you will also need to leave this one until you learn about file uploading.
$_SESSION and $_COOKIE
These two are used to access information about a user's accessing of a site. Cookies are used to store information on the user's system and sessions store it on the server. Again you will learn how to do this later and they will be empty unless your scripts have put something in them.



