HTML pre-processor
The HTML pre-processor is used to provide dynamic information inside of a
standard HTML (HyperText Markup Language) document. The pre-processor is a
script, run by the WWW server, which takes the requested document as input
and returns a standard HTML document for the server to send to the client.
The script scans the input document for special pre-processor directives,
which are replaced by dynamic data based upon the particular directive.
Directive syntax
The syntax follows closely that used by the NCSA httpd WWW server, although
not as many directives are supported (yet). The directive is enclosed within
an HTML comment and takes the form:
The command and tag keywords are case insensitive. The tag value may or may
not be case sensitive, depending upon the command/tag. Generally the effect
of a command is to produce additional text to be inserted in the document.
Directive commands
ECHO
The ECHO command inserts special variables in the stream.
ACCESSES[;#]
Number of times document accessed, the access count is saved in
the file www_root:[000000]accesses.dat.
ACCESSES_ORDINAL[;#]
Number of times document accessed with suffix(e.g. 1st)
DATE_LOCAL[=fmt]
Current system time
DOCUMENT_NAME
Filename (sans path) of current document.
LAST_MODIFIED[=fmt]
Last-modified time of current document
FLASTMOD
The FLASTMOD command inserts the file modification date of a specified
file at the current point in the document being pre-processed.
If the preprocessor executable was built using the DEC C compiler, you
can follow the file="fname" or virtual="path" tag with and
fmt="fmt-str" tag. If a format string is specified, the date is
formatted using strftime() rather than ctime(). The specified format is
used as the format string for a call to strftime()
FSIZE
The FSIZE command inserts the file size in bytes (as best as can be
determined) of a specified file at the current point in the document
being pre-processed.
INCLUDE
The INCLUDE command inserts the content of another document at the
current point in the document being pre-processed.
Examples
Including a file
(file: This text is actually from a separate file. )
(virt: This text is actually from a separate file. )
File attributes
(Included size: 54, date: Thu Oct 6 23:42:39 1994)
(Alt. format lastmod: 11:42:39 PM)
Current document attributes
(document: preproc.htmlx, date: Tue Apr 25 15:54:15 1995, 257th access)
(document: preproc.htmlx, date: Tuesday, April 25, 1995 03:54:15 PM,
257 accesses)
Current time
( 2-DEC-1998 21:05:51.56)
(alt format:
December 02, 1998 09:05:51 PM)
----------------------------------------------------------------------------
David Jones, Ohio State University