Server Side Includes and Other Topics by R. Glass
Revised:

Ok, they are not exactly stupid but I really couldn't come up with a better title. Really, this is a page that will deal with miscellaneous topics about web publishing.

Server Side Includes

Server side includes (SSI) are not really HTML but rather commands passed to the server to be interperted and executed. SSI documents are known as server-side parsed HTML documents.

They are contained within the HTML comment container <!-- -->. The problem with server side includes is that you can never 'see them'. Viewing the source shows nothing. That is because the server has replaced your SSI directive with the processed command.

In general, you may not be able to do server side includes. It depends on whether your server has enabled them. For a general reference see http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html. For use on matcmp only, you can consult http://www.matcmp.sunynassau.edu/ssi.htm.

For now, I will deal with server side includes as they apply to the servers (www.matcmp.sunynassau.edu and www.polar.sunynassau.edu) in the Dept. of MAT/STA/CMP and give the syntax to accomplish this.

One thing very important about SSI is that SPACING COUNTS. In other words, the syntax must be followed EXACTLY! Also, remember, SSI will not take effect until your page is copied to the server. In general the format of the SSI is:

<!--#command command_argument="argument_value" -->

Remember, the spacing counts and thebold-italics text is for the particular SSI, or so I have been told. Books I have state that there must be a space before the closing -->. It seems on both Polar and Matcmp, it is not required.

Dating your page.

It is often useful to place a the date of last page change on your page. This can be accomplished automatically by using the echo command of SSI to display the contents of the variable LAST_MODIFIED.

<!--#echo var="LAST_MODIFIED"-- >


Note that there is NO space before the # and one space bettem the " and the closing -->
here it is:
There are other variables you can echo. Use the same syntax as above but replace the name with that in the first column.
Variable NameSyntaxResult
DATE_LOCAL <!--#echo var="DATE_LOCAL"-->
DOCUMENT_NAME <!--#echo var="DOCUMENT_NAME" -->
DOCUMENT_URI <!--#echo var="DOCUMENT_URI" -->
DATE_GMT <!--#echo var="DATE_GMT" -->

Showing the last modified date of another page.

Sometime, you may want to show the last date of modification of an addtional page of yours or some otehr page on the server. This is accomplished with the #flastmod command. For example, you wanted your home page (index.htm) to show the last modified date of an assign.htm page. The syntax would be:

<!--#flastmod virtual="/~yourid/assign.htm" -->
.

Here is is:

The home page of R. Glass was last modified on:

The syntax I used was: <!--#flastmod virtual="/~glassr" -->

Changing the Date Format.

What you may have noticed is that the dates are quite ugly showing the exact minute the page weas changed. You may wish to change that format. That can be accomplished with the #config timefmt instruction. The syntax is:

<!--#config timefmt="string format" -->

The string format to make the date of a page appear as DDD, NN YYYY would be:

<!--#config timefmt="%b %d, %Y" -->

Here is a #config timefmt followed by a #flastmod of my home page:

The home page of R. Glass was last modified on:

IMPORTANT It seeems that the Novell server matcmp does not look at the time format for the command <!--#echo var="LAST_MODIFIED"-->. Rather, I use the #flastmod to date the current page. On polar the <!--#echo var="LAST_MODIFIED"--> does obey whatever your #config timefmt is. You must do the #config timefmt prior to the #flastmod.
Format Meaning
%a Abbreviated weekday
%A Full weekday
%b Abbreviated month name
%B Full month name
%c Preferred date and time for the current locale
%d day 1-31
%m Month 1-12
%U Week number (Sunday first)
%W Week number (Monday first)
%w Day, Sunday=0
%x Preferred date for the current locale
%y Year 00-99
%Y Year with century
%H Hour 00-23
%I Hour 01-12
%j day 001-366
%M Minute
%p am/pm
%S Second
%X Preferred time for the current locale
%Z Time zone

Counting your Hits. (NOVELL ONLY)

To make a hit counter on you use the SSI

<!--#count file="filename" -->

where filename is any vaild DOS filename.

This page was accessed times

was accomplished with the SSI <!--#count file="tricks.txt"-->

Watch here for future topics