CGI Programming on the World Wide WebBy Shishir Gundavaram
1st Edition March 1996
This book is out of print, but it has been made available online through the O'Reilly Open Books Project.
The config SSI command allows you to select the way error messages, file size information, and date and time are displayed. For example, if you use the include command to insert a non-existing file, the server will output a default error message like the following:
[an error occurred while processing this directive]
By using the config command, you can modify the default error message. If you want to set the message to "Error, contact email@example.com" you can use the following:
<!--#config errmsg="Error, contact firstname.lastname@example.org"-->
You can also set the file size format that the server uses when displaying information with the fsize command. For example, this command:
will force the server to display the file size rounded to the nearest kilobyte (K). You can use the argument "bytes" to set the display as a byte count:
Here is how you can change the time format:
<!--#config timefmt="%D %r"--> The file address.html was last modified on: <!--#flastmod file="address.html"-->.
The output will look like this:
The file address.html was last modified on: 12/23/95 07:17:39 PM
The %D format specifies that the date should be in mm/dd/yy format, while the %r format specifies "hh/mm/ss AM|PM" format. Table 5.3 lists all the data and time formats you can use.
Table 5.3: SSI Time Formats
Day of the week abbreviation
Day of the week
Month name abbreviation (see %h)
01 (not 1)
Date as "%m/%d/%y"
24-hour clock hour
12-hour clock hour
Decimal day of the year
AM | PM
Time as "%I:%M:%S %p"
24-hour time as "%H:%M:%S"
Week of the year (also %W)
Day of the week number
Year of the century
Back to: CGI Programming on the World Wide Web
© 2001, O'Reilly & Associates, Inc.