search

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
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
HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

Understanding HTML, CSS, and JavaScript: A Beginner's GuideUnderstanding HTML, CSS, and JavaScript: A Beginner's GuideApr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The Role of HTML: Structuring Web ContentThe Role of HTML: Structuring Web ContentApr 11, 2025 am 12:12 AM

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

See all articles

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 agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.