2.1/22 using SSI for "date last changed"

From:    "furler" <furler@furler.net>
To:    "NormTakahashi97P/M Classic 2.5.7print" <normtaka@webtv.net>
Subject:    Re: using SSI for "date last changed"
Date:    Wed, Jan 23, 2002, 1:42pm (PST+3)
X-Priority:    3
X-MSMail-Priority:    Normal


----- Original Message -----
From: "NormTakahashi97P/M Classic 2.5.7print" <normtaka@webtv.net>
To: <Lminor7@yahoo.com>; <furler@furler.net>
Cc: <normtaka@webtv.net>
Sent: Tuesday, January 22, 2002 10:44 AM
Subject: using SSI for "date last changed"

Teach Yourself CGI Programming with PERL 5 in a Week, 2E


Chapter 3 -- Using Server Side Include Commands http://docs.rinet.ru:8080/CP7/ch3.htm

Automatically Adding the Last Modification Date to Your Page

Now that you know what it takes to make SSIs work on your server, you might be asking yourself, "What good are they?" Well, as you've surfed around the Web, I'm sure you've seen pages that include the last time they were modified, like the one in Figure 3.1.

Figure 3.1 : Including the last modified date on your Web page.

At the bottom of Figure 3.1, the date the file was last modified is printed. If you try to look at the HTML source that produced this file, you will see only normal HTML commands and the date displayed on the Web page. I have deleted most of the HTML that builds this Web page, but the HTML you should be interested in is on line 14 of the snippet shown in Listing 3.2. It sure doesn't look special, does it? You can't guarantee that the author just isn't changing the date manually, but I suspect that an SSI is responsible for the date on line 14.

Listing 3.2. HTML including the last modified date on your Web page.

    [prior HTML deleted]



Wanna suggest a topic? Wanna be
03: notified when new lessons are on line, or

04: are made?



 * Comments to Brian
07:(bex@ncsu.edu) 08:
09:  * 10: To bex's home page 11: on the CATT WWW Server


http://www.halsoft.com/html-val-svc/"> HTML 3.0 Checked! 14: Last Updated and Validated on September 17, 1995 15:

16: 17:

The HTML that produced the line
Last Updated and Validated on September 17, 1995 did not require the author to change the date every time the HTML file was modified. The SSI directive
[an error occurred while processing this directive]
checks the last modified field of the HTML file-file.shtml-and sends it to the client along with the rest of the HTML in file.shtml. So, even though I'm not responsible for the HTML in Figure 3.1, I suspect that line 14 looks something like this:
Last Updated and Validated on [an error occurred while processing this directive]

Notice something very special about SSIs: When your server processes the SSI command, it includes the result of the SSI command in your HTML in place of the command itself.

That example is pretty simple, as are most of the SSI commands. And that is their purpose: to allow simple dynamic additions to your HTML files with very little effort. This example gives you a new perspective on some of the neat things you can do with your Web page without having to expend a lot of programming effort.