MikroSight.com

MikroSight.com

| Home | NPA/NPX |

Google
Web
MikroSight

Server Side Includes
& Environment Variables

<!--#echo var="REDIRECT_STATUS" --> this is something I am currently testing to see what it contains under various conditions.

(none)

<!--#echo var="DATE_LOCAL" --> gets the Date/Time string adjusted to the Server's Local Time.  Information on changing the format.

Monday, 18-Aug-2025 14:45:04 CDT

<!--#echo var="DATE_GMT" --> returns the Date/Time string in Greenwich Mean Time.  Information on changing the format.

Monday, 18-Aug-2025 19:45:04 GMT

<!--#echo var="HTTP_REFERER" --> returns the Page that made requested.  If the user typed this URL into the browser address bar, this returns "(none)".

(none)

<!--#echo var="REMOTE_ADDR" --> returns the user's IP address as seen at the server.

216.73.216.132

<!--#echo var="DOCUMENT_NAME" --> returns the name of the page containing the command.

ssi.shtml

<!--#echo var="DOCUMENT_URI" --> returns the document path relative to the root web.

/tutorials/ssi/ssi.shtml

<!--#echo var="LAST_MODIFIED" --> returns the date this page was last modified.   Information on changing the format.

Monday, 01-Dec-2008 11:40:59 CST

<!--#echo var="HTTP_USER_AGENT" --> returns information about the user's browser software.

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)

<!--#echo var="REMOTE_HOST" --> returns the user's Host name.

(none)

<!--#echo var="SERVER_SOFTWARE" --> returns information about the software running on this root web's server.

Apache/2

<!--#echo var="SERVER_NAME" --> returns the root web's name.

www.mikrosight.com

<!--#include virtual="ssi-include.shtml" --> will include the contents of another file name "ssi-include.shtml" into the current HTML document at the location of this command. Note the file path is not qualified, so the file would be in the current directory, but including files from other directories is allowed. The path should be relative to the root web.

This text is actually located in the file http://www.mikrosight.com/tutorials/ssi/ssi-include.shtml and has been inserted into this document as an example of the SSI include command.  My first attempt at this was using a text file name ssi-include.txt and although the server processed the include, all the SSI commands contained in this file did NOT function.

This file contains not only text, but other SSI commands as well as HTML formatting. As an example - This sentence is green using a CSS class for a <span> tag.  This sentence is underlined using the <u> </u> HTML tags.  Here is a 2 row HTML table with the top row divided into 2 columns.  Each cell contains additional SSI commands

Server Date/Time is Monday, 18-Aug-2025 14:45:04 CDT

Your current IP Address is 216.73.216.132

This SSI command returns the current page name.  Note that this will NOT return the filename as shown above since this file is included into another HTML document.

  ssi.shtml

<!--#fsize virtual="ssi-include.shtml" --> returns the size of the given file into the HTML page at the location of this command.  This example returns the file size of the file included above.

1.7K

For more information on Server Side Includes, see these references or do a search of the Web for the term "SSI" using your favorite search engine.

If you would like to try these on your website, save this text page to a new page in your web, and save it with an SHT or SHTML extension. To see an example of this in action, I have saved the text file mentioned above as ssitest.shtml

Alternately, you can right click the link and select "Save Target As" and save it in your web with the .SHT or .SHTML extension

Note: Unix/Linux based servers are UPPER/lower case sensitive.