Using
the Web

  Training

  About CIN

  City of St. Louis

Creating Web Pages:
Server-Side Includes

Description
A server-side include is a script imbedded in a web page. When the page is accessed the server-side include will reference the web server for specific information. Examples: the number of times the page has been visited or the last time the page was updated.

It's important when putting a server-side include in a web page that you always FTP the file to edit the page. If you use View-Source or Save As in your browser, you will only see the results of the server-side include and not the coding.

Be careful with this coding, it must be entered exactly (spelling and capitalization) as it appears below.

Last Updated Date
Automatically updates every time the file is saved.

<P>This Page Last Modified:
<!--#config timefmt="%D"-->
<!--#echo var="LAST_MODIFIED"-->

Results will be returned in the following format:
This Page Last Modified: xx/xx/xx

Counter
Counts the number of times the web page has been loaded.

<P>You are visitor number
<!--#exec cgi="/cgi-bin/counter.cgi"-->
since
<!--#exec cgi="/cgi-bin/counterdate.cgi"-->.

Results will be returned in the following format:
You are visitor number x since day month date time year.

CIN Footer
Displays the CIN Footer with links to the home page and terms of use.

<!-- CIN FOOTER BEGINS -->
<!--#include virtual="/custom/footer.html"-->
<!-- CIN FOOTER ENDS -->

Hiding the Results
If you do not want the counter or last updated date to appear on the web page you can put the server-side include coding in comment tags. The information will not appear on the web page but if you use "View-Source" in your browser you will see the results.

For example:
<!--
<P>You are visitor number
<!--#exec cgi="/cgi-bin/counter.cgi"-->
since
<!--#exec cgi="/cgi-bin/counterdate.cgi"-->.
-->


Return to CIN Homepage    © City of St. Louis | Terms of Use | Privacy | Accessibility

This Page Last Modified: Monday, 19-Nov-2007 16:42:39 CST