ENV variables available to SHTML documents

Thanks to Joe Smith for providing this SSI tutorial.

The variables can be included in a server-parsed (*.shtml) document using
<!--#echo var="VARIABLE_NAME"-->.

Variables defined by server's envronment and configuration file

DOCUMENT_ROOT=
    (document directory base)
SERVER_NAME=
    (set to the virtual host the client is connected to)
SERVER_PORT=
    (the default port for HTTP is 80)
SERVER_PROTOCOL=
    (usually set to "HTTP/1.0")
SERVER_SOFTWARE=
    (such as SAMBAR 4.2 or Apache/1.2.6)

Variables set from the browser's HTTP request

Not all browsers send this information.
HTTP_ACCEPT= 
    (usually includes image/gif and image/jpeg)
HTTP_HOST=
    (host name from URL, browser used this for the DNS lookup for IP address)
HTTP_REFERER=
    (this is page that had the link to here, not set if URL typed in manually)
HTTP_USER_AGENT=
    (name of browser; Microsoft Internet Explorer is "Mozilla compatible")
AUTH_TYPE=
    (set only on password protected pages)
REMOTE_USER=
    (set only on password protected pages after user name is entered)

CGI variables (for Common Gateway Interface programs)

Some of these variables may be set for SHTML documents, but they are defined for use by CGI programs.
CONTENT_LENGTH=
    (set for <FORM ACTION="POST">)
GATEWAY_INTERFACE=
    (usually set to "CGI/1.1")
PATH_INFO=
    (set if extra characters follow the CGI script name on original URL)
REQUEST_METHOD=
    (usually GET or POST)
QUERY_STRING=
    (set for ISMAP, ISINDEX, METHOD=GET, or a URL with a question mark)

Common variables (for documents and CGI programs)

REMOTE_ADDR=
    (IP address where browser is running)
REMOTE_HOST=
    (host name, if reverse DNS lookup succeeds)
DATE_GMT=
DATE_LOCAL=

Document variables (not set up for simple CGI references)

DOCUMENT_URI=
  (virtual name, same as REQUEST_URI except for nested includes)
DOCUMENT_NAME=
  (name of file without the directory components)
LAST_MODIFIED=
  (last modified for *.shtml including the time zone.)

CGI from inside HTML

Note that because the CGI script is invoked by <!--#EXEC CGI="scriptname"--> instead of by <A HREF="scriptname"> then it inherits from the parent document DATE_GMT, DATE_LOCAL, DOCUMENT_URI, DOCUMENT_NAME, LAST_MODIFIED. It also inherits the parent's QUERY_STRING.