[0001] [0002] [0003] [0004] [0005] [0006] [0007] [0008] [0009] [0010] [0011] [0012] [0013] [0014] [0015] [0016] [0017] [0018] [0019] [0020] [0021] [0022] [0023] [0024] [0025] [0026] [0027] [0028] [0029] [0030] [0031] [0032] [0033] [0034] [0035] [0036] [0037] [0038] [0039] [0040] [0041] [0042] [0043] [0044] [0045] [0046] [0047] [0048] [0049] [0050] [0051] [0052] [0053] [0054] [0055] [0056] [0057] [0058] [0059] [0060] [0061] [0062] [0063] [0064] [0065] [0066] [0067] [0068] [0069] [0070] [0071] [0072] [0073] [0074] [0075] [0076] [0077] [0078] [0079] [0080] [0081] [0082] [0083] [0084] [0085] [0086] [0087] [0088] [0089] [0090] [0091] [0092] [0093] [0094] [0095] [0096] [0097] [0098] [0099] [0100] [0101] [0102] [0103] [0104] [0105] [0106] [0107] [0108] [0109] [0110] [0111] [0112] [0113] [0114] [0115] [0116] [0117] [0118] [0119] [0120] [0121] [0122] [0123] [0124] [0125] [0126] [0127]
<!-- 15-JAN-97 MGD some paths modified for WASD directory structure --> <!--#begin test--> <HTML> <HEAD> <TITLE>HTML preprocessor (server-side includes)</TITLE> </HEAD> <BODY> <!--#end test --> <H1>HTML pre-processor</H1> 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 <em>directives</em>, which are replaced by dynamic data based upon the particular directive. <!--#config verify="1"--> <P> <H2>Directive syntax</H2> The syntax follows closely that used by the <A HREF="//hoohoo.ncsa.uiuc.edu/">NCSA httpd</A> WWW server, although not as many directives are supported (yet). The directive is enclosed within an HTML comment and takes the form: <DL><DT></DT><DD><!--#<b>command</b> [[<b>tag</b>="value"] ...]--><DD> </DL> 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. <H2>Directive commands</H2> <DL> <DT>BEGIN</DT> <DD>The BEGIN directive marks the start of a region that may be selectively included with a part-qualified INCLUDE directive. A single BEGIN or END directive may specifiy multiple part names to begin or end at that point</DD> <P><DT>ECHO</DT> <DD>The ECHO command inserts special variables in the stream.</DD> <DL> <DT>ACCESSES[;#]</DT><DD>Number of times document accessed, the access count is saved in the file www_root:[000000]accesses.dat.</DD><P> <DT>ACCESSES_ORDINAL[;#]</DT><DD>Number of times document accessed with suffix(e.g. 1st)</DD><P> <DT>DATE_LOCAL[=fmt]</DT><DD>Current system time</DD><P> <DT>DOCUMENT_NAME</DT><DD>Filename (sans path) of current document</DD><P> <DT>GETENV=symbol</DT><DD>Value of specified DCL symbol or logical</DD><P> <DT>HW_NAME</DT><DD>Hardware model number</DD><P> <DT>LAST_MODIFIED[=fmt]</DT><DD>Last-modified time of current document</DD><P> <DT>SERVER_NAME</DT><DD>Hostname of current server</DD><P> <DT>SERVER_VERSION</DT><DD>Server software version string</DD><P> <DT>VMS_VERSION</DT><DD>Operating system version number</DD> </DL> <P><DT>END</DT> <DD>The END directive marks the end of a region started by a previous BEGIN directive (see BEGIN). A file may specify more than one region with matching BEGIN/END pairs.</DD> <P><DT>FLASTMOD</DT> <DD>The FLASTMOD command inserts the file modification date of a specified file at the current point in the document being pre-processed. <P> 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() </DD> <P><DT>FSIZE</DT> <DD>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. </DD> <P><DT>INCLUDE</DT> <DD>The INCLUDE command inserts the content of another document at the current point in the document being pre-processed. Optionally, you may specify an part tag and name and only the named regions (see BEGIN and END directives) in the file will be inserted. </DD> </DL> <!--#begin "examples" "test"--> <H2>Examples</H2> <DL> <DT>Including a file</DT> <DD><!--#include file="open_hours.html"--><BR> <!--#include file="open_hours.html" part="holiday"--><BR> <!--#include virtual="/wasd_root/src/osu/admin/open_hours.html"--> <BR>(file: <!--#include file="preproc.inc"-->) <BR>(virt: <!--#include virtual="/wasd_root/src/osu/preproc.inc"-->) <BR>(virt(rel): <!--#include virtual="../../src/osu/preproc.inc"-->) </DD> <P><DT>File attributes</DT> <DD><!--#fsize file="portrait.gif"--><BR> <!--#flastmod virtual="/wasd_root/src/osu/admin/open_hours.html" fmt="%I:%M:%S %p"--> <BR>(Included size: <!--#fsize file="preproc.inc"-->, date: <!--#flastmod file="preproc.inc"-->) <BR>(Alt. format lastmod: <!--#flastmod file="preproc.inc" fmt="%I:%M:%S %p" -->) </DD> <P><DT>Current document attributes</DT> <DD><!--#echo var="DOCUMENT_NAME"--><BR> <!--#echo var="LAST_MODIFIED[=fmt]"--><BR> <!--#echo var="ACCESSES"--><BR> <!--#echo var="ACCESSES_ORDINAL;5"--> <BR>(document: <!--#echo var="DOCUMENT_NAME"-->, date: <!--#echo var="LAST_MODIFIED"-->, <!--#echo var="ACCESSES_ORDINAL;3"--> access) <BR>(document: <!--#echo var="DOCUMENT_NAME"-->, date: <!--#echo var="LAST_MODIFIED=%A, %B %d, %Y %I:%M:%S %p"-->, <!--#echo var="ACCESSES"--> accesses) </DD> <P><DT>Current time</DT> <DD><!--#echo var="DATE_LOCAL"--> (<!--#echo var="DATE_LOCAL"-->)<BR> <!--#echo var="DATE_LOCAL=%B %d, %Y %I:%M:%S %p"--> (alt format: <!--#echo var="DATE_LOCAL=%B %d, %Y %I:%M:%S %p"-->)</DD> <P><DT>Miscellaneous echo vars</DT> <DD><!--#echo= var="GETENV=SYS$REM_ID"--> (<!--#echo var="GETENV=SYS$REM_ID"-->)<BR> <!--#echo var="SERVER_NAME"--><BR> <!--#echo var="SERVER_VERSION"--><BR> <!--#echo var="VMS_VERSION"--><BR> <!--#echo var="HW_NAME"--><BR> (Host <!--#echo var="SERVER_NAME"--> is a <!--#echo var="HW_NAME"--> running the <!--#echo var="SERVER_VERSION"--> HTTP server under VMS <!--#echo var="VMS_VERSION"--> ) </DL> <!--#end "test" "examples"--> <HR> <ADDRESS>David Jones, Ohio State University</ADDRESS> <!--#begin test--> </BODY> </HTML> <!--#end test-->