Home Web Front-end HTML Tutorial STHML tutorial(2)

STHML tutorial(2)

Apr 05, 2017 am 09:40 AM

Basic format of SSI command

code:

illustrate:

  1. is a comment in HTML syntax. When the WEB server does not support SSI, this information will be ignored.


  2. #include is one of the SSI directives.


  3. 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:

  1. 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 root

    Notice:

    1. The file name must have an extension.


    2. 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 length

    grammar:


    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 means

    NOTE: 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 program

    Example:

    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:

    1. Apache, delete the "Options Includes ExecCGI" line in access.conf;


    2. 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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

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

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

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

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

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.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

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

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

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

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

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

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

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

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

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

See all articles