Page 212 - Open Soource Technologies 304.indd
P. 212
Web Technologies-I
Notes SERVER_PROTOCOL
The name and revision of the request protocol (e.g., “HTTP/1.1”).
SERVER_PORT
The server port number to which the request was sent (e.g., “80”).
REQUEST_METHOD
The method the client used to fetch the document (e.g., “GET”).
PATH_INFO
Extra path elements given by the client (e.g., “/list/users”).
PATH_TRANSLATED
The value of PATH_INFO, translated by the server into a filename (e.g., “/home/httpd/
htdocs/list/users”).
SCRIPT_NAME
The URL path to the current page, which is useful for self-referencing scripts (e.g., “/~me/
menu.php”).
QUERY_STRING
Everything after the ? in the URL (e.g., “name=Fred+age=35”).
REMOTE_HOST
The hostname of the machine that requested this page (e.g., “dialup-192-168-0-1.example.
com”). If there’s no DNS for the machine, this is blank and REMOTE_ADDR is the only
information given.
REMOTE_ADDR
A string containing the IP address of the machine that requested this page (e.g.,
“192.168.0.258.
AUTH_TYPE
If the page is password-protected, this is the authentication method used to protect the
page (e.g., “basic”).
REMOTE_USER
If the page is password-protected, this is the username with which the client authenticated
(e.g., “fred”). Note that there’s no way to find out what password was used.
REMOTE_IDENT
If the server is configured to use identd (RFC 931) identification checks, this is the username
fetched from the host that made the web request (e.g., “barney”). Do not use this string
for authentication purposes, as it is easily spoonfed.
CONTENT_TYPE
The content type of the information attached to queries such as PUT and POST (e.g.,
“x-url-encoded”).
CONTENT_LENGTH
The length of the information attached to queries such as PUT and POST (e.g., 3952).
The Apache server also creates entries in the $_SERVER array for each HTTP header in the
request. For each key, the header name is converted to uppercase, hyphens (-) are turned into
206 LOVELY PROFESSIONAL UNIVERSITY