![]() |
|
| • All Online Courses • New Courses • QuickTips • Word Definitions • Submit a Tutorial • Links • |
|
Beginning CGI Programming with Perl Using the SSI config CommandThe config command stands for configuration. You will never see this command appear anywhere on your Web page. But you will find it a very useful command for changing the look of other SSI commands on your Web page. The config command modifies the standard text output from an SSI error command. You should use the config command if you want to perform actions such as these:
By now, you should be able to deduce that the config command modifies the output of other SSI commands. In particular, the config command modifies how the following are displayed on your Web page:
Table 3.2 summarizes the command options for the SSI config command. The syntax of the command is similar to that of all other SSI commands: <!--#Command Command-Argument="Argument-Value" --> Table 3.2. Command options for the config command.
Why would you want to use this command? The most common use is to change the date printed when using the flastmod SSI command. The flastmod SSI command prints the last modified date of a file. If you use your SSI commands to perform more complex tasks, however, like executing a CGI or system command, you might find it useful to return a polite error message. Perhaps the requested CGI program is available only to registered users, for example. You could change the error message to return a polite I'm sorry, this function is available only to registered users instead of the rather cryptic default error message of ["an error occurred while processing this directive"] If you are changing the error message to try to debug your scripting errors, however, the error log is a better tool than the config errmsg command. The error log is covered in Tutorial 13, "Debugging CGI Programs." The syntax of the config errmsg command follows: <!--#config errmsg="You can put any message here" --> The second valid command-argument affects mainly the fsize command. It changes whether the size returned by the fsize is returned in bytes or in a rounded-up kilobyte format. The command-argument is sizefmt, which accepts the argument values of bytes or abbrev. The syntax of the config sizefmt command follows: <!--#config sizefmt="bytes" --> or <!--#config sizefmt="abbrev" --> Finally, the timefmt command argument is quite useful. You can use this inside regular text to return a date or time formatted to your preference. Whether you want only the day of the week, the current hour, or a full GMT date stamp, timefmt enables you to format the current date to fit all your needs. Table 3.3 shows all the possible variations for the date format. It's amazing how many varieties of time are available to you. The format for configuring the time follows: <!--#config timefmt="Any valid grouping of format codes" --> If you want to print the day of the week, followed by the month, day of the month, and then the year, use this SSI command: <!--#config timefmt="%A, %B %d, %Y" -->
by Frontsource.com.pk Find more free Internet tutorials from Learnthat.com. More Information:
Help us by rating this tutorial: [---] [--] [+] [++] [+++] [---] lowest; [+++] highest
|
|
||||||||||||||||||
![]() |
Learn: Free
Tutorials - Links
to Free Tutorials
Understand: Free Technical Definitions
- ExplainThat Whitepapers
Use: Certification Section -
Discussion Forum
Visit Our Network Sites:
About Us : Contact Us : Advertise : Privacy Information