SSI or Server Side Includes are used to add contents of other files or variables from the server directly into html web pages.
To use this function your web pages must use the suffix ".shtml" rather than ".html" or ".htm", i.e. index.shtml not index.html.
Server Side Includes are particularly useful for including a common piece of code throughout a site, such as a page header or a page footer.
For example, certain web pages could have copyright information included in them by placing the following code into the web pages:
<!--#include virtual="../copyright.txt" -->
When any changes are made to the copyright.txt file, all pages that include the code will display the updated information.
Server Side Includes may also be used to display system variables such as the current time. Some common SSI codes are:
<!--#echo var="HTTP_REFERER" --> (displays referring URL)
<!--#echo var="REMOTE_ADDR" --> (displays visitor's IP address)
<!--#echo var="REQUEST_URI" --> (displays requested URL)
<!--#echo var="HTTP_HOST" --> (displays server name)
<!--#echo var="HTTP_USER_AGENT" --> (displays visitor's browser)
<!--#echo var="REDIRECT_STATUS" --> (displays redirect status code)
<!--#echo var="DATE_LOCAL" --> (displays visitor's date and time)
<!--#include virtual="path/file.ext" --> (includes the specified file)