<p>To include an SSI variable simply use the variable name in place of the type of data you want to display. This example shows how to implement the inbuilt <span class="keyword">#SSI_DATELONG</span> variable to display the current date every time a page is requested.</p> <p>We start with a very basic HTML page:</p> |
<HTML> <BODY> <H2>Welcome to my page. The date is 1 January 2012.</H2> </BODY> </HTML> |
<p>This is clearly inappropriate because if a user requests your page on, say, 14 February 2013, the date will be incorrect.</p> <p>So to force the web server to show the correct date, simply substitute the text for the variable name, in this case <span class="keyword">#SSI_DATELONG</span>.</p> |
<HTML> <BODY> <H2>Welcome to my page. The date is #SSI_DATELONG.</H2> </BODY> </HTML> |
<p>If this page is now requested, it will look as the one below:</p> <img class="screenshot naked" src="http://www.tri-line.com/common/img/documentation/tim_professional/server_side_example.png" alt="Example of Server-Side Includes" /> <p>The result is that the variable <span class="keyword">#SSI_DATELONG</span> was replaced by the text '21 September 2012'.</p> |