Environment Variables

This is the general list of environment variables. These are a series of hidden values that the web server sends to every script you run. These are generally avaiable to CGI, GSL, PL, XML and most other scripts.

Variable NameValue
DOCUMENT_ROOTThe root directory of your server
HTTP_COOKIEThe visitor's cookie, if one is set
HTTP_HOSTThe hostname of your server
HTTP_REFERERThe URL of the page that called your script
HTTP_USER_AGENTThe browser type of the visitor
HTTPS"on" if the script is being called through a secure server
PATHThe system path your server is running under
QUERY_STRINGThe query string
REMOTE_ADDRThe IP address of the visitor
REMOTE_HOSTThe hostname of the visitor (if your server has reverse-name-lookups on; otherwise this is the IP address again)
REMOTE_PORTThe port the visitor is connected to on the web server
REMOTE_USERThe visitor's username (for .htaccess-protected pages)
REQUEST_URIThe interpreted pathname of the requested document or CGI (relative to the document root)
SCRIPT_FILENAMEThe full pathname of the current CGI
SCRIPT_NAMEThe interpreted pathname of the current CGI (relative to the document root)
SERVER_ADMINThe email address for your server's webmaster
SERVER_NAMEYour server's fully qualified domain name (e.g. www.cgi101.com)
SERVER_PORTThe port number your server is listening on
SERVER_SOFTWAREThe server software you're using (such as Apache 1.3)