Table of Contents | Previous | Next | Index | Bookshelf

NSAPI Programmer's Guide for iPlanet Web Server


Appendix F
Server-Parsed HTML Tags

HTML files can contain tags that are executed on the server. This appendix discusses the standard server-side tags you can include in HTML files.

For information about defining your own server-side tags in iPlanet Web Server 4.x, see the Programmer's Guide for iPlanet Web Server.

Note: The server parses server-side tags only if server-side parsing has been activated. Use the "Parse HTML" page in the Content Management tab of the Server Manager interface to enable or disable the parsing of server-side tags.

When you activate parsing, you need to be sure that the following directives are added to your obj.conf file (Note that native threads are turned off.):

Init funcs="shtml_init,shtml_send" shlib="install_dir/bin/https/bin/Shtml.dll" NativeThreads="no" fn="load-modules"
Init LateInit = "yes" fn="shtml_init"

Using Server-Parsed Commands

This section describes the HTML commands for including server-parsed tags in HTML files. These commands are embedded into HTML files which are processed by the built-in SAF parse-html.

The server replaces each command with data determined by the command and its attributes.

The format for a command is:

<!--#command attribute1 attribute2 ... -->
The format for each attribute is a name-value pair such as:

name="value"
Commands and attribute names should be in lower case.

As you can see, the commands are "hidden" within HTML comments so they are ignored if not parsed by the server. Following are details of each command and its attributes.

config

The config command initializes the format for other commands.

Example:

<!--#config timefmt="%r %a %b %e, %Y" sizefmt="abbrev"-->
This sets the date format like 08:23:15 AM Wed Apr 15, 1996, and the file size format to the number of KB or MB of characters used by the file.

include

The include command inserts a file into the parsed file (it can't be a CGI program). You can nest files by including another parsed file, which then includes another file, and so on. The user requesting the parsed document must also have access to the included file if your server uses access control for the directories where they reside.

Example:

<!--#include file="bottle.gif"-->

echo

The echo command inserts the value of an environment variable. The var attribute specifies the environment variable to insert. If the variable is not found, (none) is inserted. See below for additional environment variables.

Example:

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

fsize

The fsize command sends the size of a file. The attributes are the same as those for the include command (virtual and file). The file size format is determined by the sizefmt attribute in the config command.

Example:

<!--#fsize file="bottle.gif"-->

flastmod

The flastmod command prints the date a file was last modified. The attributes are the same as those for the include command (virtual and file). The date format is determined by the timefmt attribute in the config command.

Example:

<!--#flastmod file="bottle.gif"-->

exec

The exec command runs a shell command or CGI program.

Example:

<!--#exec cgi="workit.pl"-->

Environment Variables in Commands

In addition to the normal set of environment variables used in CGI, you may include the following variables in your parsed commands:


Table of Contents | Previous | Next | Index | Bookshelf

Last Updated: 03/01/00 09:22:25

© Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.