jas8@lehigh.edu
The way this actually works is the server scans certain files for the
occurrence of special commands called directives. They take the form
of special elements in the document. For example, an element with the
name !--#include tells httpd to search out another
document and transmit it in place of this element. In this case,
include is the name of the directive.
To quote the manual again, "Having the server parse documents is
a double edged sword. It can be costly for heavily loaded servers to
perform parsing of files while sending them."
-NCSA httpd docs. Because of this overhead, some
administrators choose not to allow server includes at all, whole most
who do configure the server so it only parses files with the extension
.shtml. This is so the overhead of the macro processor
is not run on every single file. This means that if you have the
ability to do server includes, you probably have to rename your files
so they have the .shtml extension for server includes to
work.
.shtml extension are
parsed. This has been done for the convenience of the users. Please
do not force them to disable the feature by abusing it. I suggest
including only files in your own directory and also not including
large files. Also, avoid nesting includes too far.
signature.html.
It can look something like the following:
jas8@Lehigh.edu.
Jeff Spirko
jas8@lehigh.edu
<!--#include file="include/signature.html"-->
.shtml extension.
include
<!--#include file="filename"
--><!--#include virtual="URL name"
-->
include directive includes the described file or
URL reference in your document. You can
include files to be parsed. There are two valid tags:
file takes a pathname relative to the
current directory. The parent directory (../) cannot be used in this
pathname, nor can absolute paths be used.
virtual takes a URL name. It has to be on the same
server as the file including it.
echo
<!--#echo var="Variable Name"
-->
echo directive prints the value of one of the include
variables (defined below). Any dates are printed subject to the
currently configured timefmt. The one valid tag is:
var tag takes the name of the variable you wish
to echo.
fsize
<!--#fsize file="filename"
--><!--#fsize virtual="URL name"
-->
fsize directive prints the size of the specified file. The
resulting text of this command is subject to the sizefmt
parameter to the config command. The tags are the same
as the above include command.
flastmod
<!--#flastmod file="filename"
--><!--#flastmod virtual="URL name"
-->
flastmod directive prints the last modification date of the
specified file, subject to the formatting preference given by the
timefmt parameter to config. The tags are
the same as with the include command.
config
<!--#config errmsg="Message"
--><!--#config timefmt="Format"
--><!--#config sizefmt="Format"
-->config directive controls various aspects aspects of
the file parsing. There are three valid tags:
errmsg controls what message is sent back to the
client if an error includes while parsing the document. When an error
occurs, it is logged in the server's error log.
timefmt gives the server a new format to use when
providing dates. This is a string compatible with the
strftime library call under most versions of UNIX.
sizefmt determines the formatting to be used when
displaying the size of a file. Valid choices are bytes,
for a formatted byte count (formatted as 1,234,567), or
abbrev for an abbreviated version displaying the number
of kilobytes or megabytes the file occupies.
DOCUMENT_NAME: The current filename.
DOCUMENT_URI: The virtual path to
this document (such as /~robm/foo.shtml).
QUERY_STRING_UNESCAPED: The
unescaped version of any search query the client sent, with all
shell-special characters escaped with \.
DATE_LOCAL: The current date,
local time zone. Subject to the timefmt parameter to the
config command.
DATE_GMT: Same as DATE_LOCAL but
in Greenwich mean time.
LAST_MODIFIED: The last
modification date of the current document. Subject to
timefmt like the others.
Good luck!
Comments and constructive criticism of this document are welcome.
I'm not quite ready for English Professors, though. :-)
This page has been accessed
times since October 4, 1995
at 10:55 AM.
Lehigh University | Examples, Templates, Scripts, and Icons | Jeff Spirko's Home Page.
Jeff Spirko
spirko@lehigh.NOSPAM.edu or
spirko@yahoo.NOSPAM.com