Logo Your Web Hosting Solution
SSI Tutorial
Using Variables
Including Files
Execute Scripts
Validate SSI
Tutorials Index
Home Page
SSI Tutorial - Environment Variables

Variables can be used to display information about people viewing a web page, the page itself and more.

To view a full list of available environment variables, add the below lines to a web page, upload it to your hosting account and view it in your web browser.

<!--#printenv -->

1. The Web Page

With SSI, environment variables can be used to show some information about the web page being shown.

<!--#echo var="DOCUMENT_NAME" -->
<!--#echo var="LAST_MODIFIED" -->

The first line simply shows the filename of the web page. The second shows when it was last modified.


    Filename : ssi_variables.html
    Modified : Tuesday, 14-Apr-2015 12:47:45 CDT
2. Current Time And Date

You can use SSI to include the current time and date in web pages. Both local server time or GMT can be used.

<!--#echo var="DATE_LOCAL" -->
<!--#echo var="DATE_GMT" -->


    Server Time : Tuesday, 16-Jan-2018 17:07:54 CST
    GMT Time : Tuesday, 16-Jan-2018 23:07:54 GMT
3. The Visitor

SSI can be used to display the IP address of a person viewing your web pages.

<!--#echo var="REMOTE_ADDR" -->

Remote host information can be shown (if available).

<!--#echo var="REMOTE_HOST" -->

You can even display the browser version of the visitor.

<!--#echo var="HTTP_USER_AGENT" -->


    Your IP address is :
    Your remote hostname is : (none)
    Your browser : CCBot/2.0 (http://commoncrawl.org/faq/)
These are quick and easy SSI examples, many other variables can be used with Server Side Includes.

Top Of Page 
Copyright© 1996 - 2018 Clockwatchers, Inc.