STHML tutorial(2)
Basic format of SSI command
code:
illustrate:
is a comment in HTML syntax. When the WEB server does not support SSI, this information will be ignored.
#include is one of the SSI directives.
file is the parameter of include, info.htm is the parameter value, which in this command refers to the name of the document to be included.
Notice:
-
Example:
The name of this document
Current time
Your IP address#include demonstration
Function: Insert the content of the text file directly into the document page.
grammar:
file The filename is a relative path relative to the directory containing the document using the #include directive. The included file can be in the same level directory or its subdirectory, but not in the upper level directory. For example, if it represents the nav_head.htm document in the current directory, it is file="nav_head.htm".
The virtual filename is the full path to the virtual directory on the Web site. For example, it means the nav_head.htm file in the hoyi directory relative to the server document root directory; it is file="/hoyi/nav_head.htm"Parameters:
file specifies the location of the included file relative to this document
virtual specifies the location relative to the server document rootNotice:
The file name must have an extension.
The included files can have any file extension. I find it most convenient to use the htm extension directly. Microsoft recommends using the .inc extension (it depends on your preference).
Example:
Insert the header file into the current page
Insert the tail file into the current page#flastmod and #fsize demonstration
Function:
#flastmod file last updated
#fsize file lengthgrammar:
Parameters:
file specifies the location of the included file relative to this document. For example, info.txt represents the info.txt document in the current directory
virtual specifies the location relative to the server document root directory, such as /hoyi/info.txt meansNOTE: The file name must have an extension.
Example:
Insert the latest update date of the news.htm file in the current directory into the current page
Insert the file size of news.htm in the current directory into the current page#exec demonstration
Function: Insert the output of an external program into the page. It can be inserted into CGI programs or as input to regular applications, depending on whether the parameters used are cmd or cgi.
grammar:
Parameters:
cmd regular application
cgi CGI script programExample:
The password file will be displayed
will display the file list in the current directory
The CGI program gb.cgi will be executed.
The CGI program access_log.cgi will be executed.Note: As you can see from the above example, this command is quite convenient, but it also has security issues.
Prohibited methods:
Apache, delete the "Options Includes ExecCGI" line in access.conf;
In IIS, to disable the #exec command, modify the SSIExecDisable metabase;
#config
Function: Specify the format of error information, date and file size returned to the client browser.
grammar:
Parameters:
errmsg Customize SSI execution error messages any way you like.
sizefmt file size display mode, the default is byte mode ("bytes") and can be changed to kilobyte mode ("abbrev")
timefmt time display mode, the most flexible configuration attribute.Example: Display the size of a non-existent file
Display file size in kilobytes
grammar:
Display time in a specific time format
Display today’s day of the week, month, and time zone
The above is the detailed content of STHML tutorial(2). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.
