SSI refers to Server-side include (server-side include directives)
Use server-side include directives to include the contents of the file and information about the file, such as the size of the file, in the HTML page. You can also use some server-side include directives in ASP pages.
A total of 6 articles
#config: Specifies the format to use for error messages, dates, and file sizes that are returned to the client browser.
#echo: Inserts the value of an environment variable in an HTML page.
#exec: Run an application or a shell command and insert the output into an HTML page.
#flastmod: Inserts the file modification date into the HTML page.
#fsize: Inserts the file size into the HTML page.
#include: Include files in HTML or ASP pages.
Because files containing SSI directives require special processing, an SSI file extension must be given to the SSI file. The default extension is. stm,. shtm, and. shtml. However, some SSI directives can be used in other files.
1. Include file
To include a file, use the #include directive. For example, when you need to insert a file named Char.inc in an HTML page, you can use the following directives in an HTML page: (Available in ASP)
<!--#include file= "Char.inc"-->
The HTML file that contains the #include directive must be a file published on your Web site.
To locate the included file by specifying a relative path to the current directory, use the file parameter. To locate the included file by specifying a full virtual path to the file, use the virtual parameter.
2. Contains the output of the application
To run the application or shell command, use the #exec directive. The application can be a CGI program, an ASP application, or an ISAPI application. The path to the application must be a full virtual path or URL. The way to pass parameters to an application is to follow the application name with a question mark (?) and a column of parameters that are joined by a plus sign (+). This directive can only be used in HTML pages, not in ASP pages.
Parameter CGI runs an application, such as a CGI script, ASP, or ISAPI application.
Parameter CMD to run the shell command.
3. The size of the containing file
#fsize将指定文件的大小插入 the HTML page. This directive can only be used in HTML pages, not in ASP pages.
Parameter set with #include
By default, the file size is represented in kilobytes. You can change the unit of measurement with the #config instruction with the SIZEFMT option.
Format for #config指定返回给客户端浏览器的错误信息, date, and file size. This directive can only be used in an HTML page and cannot be used in an ASP page.
Controls the message returned to the client browser when an error occurs while processing an SSI directive. Disables verbose debugging information and provides only a short error message.
Example:<!--#config errmsg= "You are wrong!"-->
Specifies the date format to return to the client browser. String parameter to specify the format. You can extract individual parts of a date by using a formatting tag in String, for example, one day of the week or one months. (the formatting marks are exactly the same as those you used when you use the Strftime function of ANSI C).
%a an abbreviation for the day of the week (for example, Mon).
%A the full name of the day of the week (for example, Monday).
The abbreviation for the%b month (for example, Feb).
%B the full name of the month (for example, February).
The representation of the date and time on the local%c (for example, 05/06/91 12:51:32).
%d a day (01-31) in the one month that is represented in decimal digits.
%H 24-hour format (00-23).
%I 12-hour format (01-12).
%j represents one day of the year (001-366) in decimal digits.
%m the Month (01-12) in decimal digits.
%m in decimal digits (00-59).
%p local morning or afternoon designator (for example, PM).
%s seconds (00-59) in decimal digits.
%u represents a week of the year in decimal digits, and Sunday as the start of the week (00-51).
%w represents a day of the week in decimal digits, and Sunday is the first day (0-6).
%w represents one day of the year in decimal digits, Monday as the beginning of the week (00-51).
%x The local date representation (for example, 05/06/91).
%x local time representation (for example, 12:51:32).
%y the Year without a century (for example, 69) in decimal digits.
%Y a century with a decimal digit (for example, 1969).
%z,%z time zone full name or abbreviation; If you do not know the time zone, there are no characters.
Example:<!--#config timefmt= "%h:%m:%s"-->
The parameter sizefmt followed by the abbrev in kilobytes, in bytes as Byte
Example:<!--#config sizefmt= "bytes"-->
5. #ECHO similar to Response.servervariables in ASP
Not in detail, it's too much.
REMOTE_ADDR, query_string, etc., should be used.
6. #flastmod Inserts the modified time of the specified file into the HTML page. This directive can only be used in HTML pages, not in ASP pages.
Parameter set with #include
So much, write exhausted, I wish you all the smooth use.