Share this Page URL

Chapter 20. Web Page Doodads You Should ... > Using Server-Side Includes to Insert... - Pg. 233

Web Page Doodads You Should Know About 233 Figure 20.1. When the server trips over the SSI include tag, it replaces the tag with the entire contents of the file specified by the tag. The Echo Tag Most servers that support SSI also support a second SSI tag: <!--#echo var="VariableName"--> This is called the SSI echo tag, and you use it to "echo" or write a specific type of data to the page. The data that gets written depends on what you specify for the VariableName. For example, you can use the LAST_MODIFIED variable: Last edited on <!--#echo var="LAST_MODIFIED"--> Here, the server replaces the SSI echo tag with the date and time that the file was last modified: Last edited on Friday, August 23 2002 03:02:59 Table 20.1 lists some of the more useful echo variable names (as well as a few that are only semi- useful). Table 20.1. Some SSI Echo Tag Variables Variable DATE_GMT DATE_LOCAL DOCUMENT_NAME DOCUMENT_URI LAST_MODIFIED HTTP_REFERER REMOTE_ADDR What It Echoes The current date and time at Greenwich (Greenwich Mean Time) The current date and time on the server The current page's server directory and name The URL of this page (less the host) The date and time this page was last modified The address the user came from to get to the current page The IP address of the user When you're using any of the date and time echo variables, the actual appearance of the output varies depending on the browser and the computer used by the surfer. Thankfully, you can control the appearance of the date and time by using the SSI config tag: