Newbie dot Org HomePage
Visit one of our web buddies
Newbie dot Org
Code Snippets

SSI -- Server Side Includes
Environmental variables

Hi 123.456.78.9, your using Browser/1.11 [en] (OS; OsVersion 1.1) your viewing file.shtml, being hosted by www.server.com on port 80, the current time is
DayOfWeek, Day-Mon-Year sec:min:hour GMT the software this server runs is HTTPD/1.1.1 (OS)

That's what might be output if you used the following on a ssi-enabled site.

Hi <!--#echo var="REMOTE_ADDR"-->, your using <!--#echo var="HTTP_USER_AGENT"--> your viewing <!--#echo var="DOCUMENT_NAME"-->, being hosted by <!--#echo var="SERVER_NAME"--> on port <!--#echo var="SERVER_PORT"-->, the current time is <!--#echo var="DATE_LOCAL"--> the software this server runs is <!--#echo var="SERVER_SOFTWARE"-->

The syntax for #echo is
<!--#echo var="THE_VARIABLE"-->
Here's a list of some environmental variables you may find useful.

CONTENT_LENGTH
DATE_LOCAL
DOCUMENT_NAME
DOCUMENT_URI
HTTP_ACCEPT
HTTP_REFERER
HTTP_USER_AGENT
LAST_MODIFIED
REMOTE_ADDR
REMOTE_HOST
REQUEST_METHOD
SCRIPT_NAME
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE

Posted by Staunch on 09/22/99 at 19:54:11