Application of SSI in PHP program _php tutorial

Source: Internet
Author: User

Application of SSI in PHP program


1. What is SSI?

Server-side embedding: Server Side Include, an ASP-based Web page authoring technology. Before you send content to your browser, you can use the server-side include (SSI) directive to include text, graphics, or application information in a Web page. For example, you can use SSI to include a time/date stamp, a copyright notice, or a form for customers to fill out and return. For text or graphics that appear repeatedly in multiple files, it is an easy way to use include files. Save the content in one of the included files without having to enter the content into all the files. The include file is called with a very simple statement that instructs the WEB server to insert the content into the appropriate Web page. Also, when you use the Include file, all changes to the content can be done in one place only.

2. What are the commands of SSI?

[1] Display server-side environment variables < #echo >
[2] Insert text content directly into the document < #include >
[3] Displaying information about Web documents < #flastmod #fsize > (such as date/size of file creation)
[4] Direct execution of various programs on the server < #exec > (such as CGI or other executable program)
[5] Set SSI information display format < #config >; (such as file date/size display) advanced SSI ; You can set variables to use the IF condition statement.

3. Apache Configuration SSI

Apache does not support SSI by default and requires us to change the httpd.conf for configuration. Here I take the Windows platform Apache 2.0.x as an example: Open the Conf directory of the httpd.conf file, modify the place

[1] Remove the previous comment

LoadModule Include_module modules/mod_include.so

[2] Modifying the directory

Will

 
      Options followsymlinks    allowoverride None
Revision changed to

 
      Options Indexes followsymlinks includes    allowoverride None
[3] Remove the previous comment and make changes

Will

#AddType text/html. Shtml#addoutputfilter includes. shtml
Revision changed to

AddType text/html. shtml. Htmladdoutputfilter includes. shtml. html
3, the source of index.html

Test SSI  
 
    
 
     

http://www.bkjia.com/PHPjc/875470.html www.bkjia.com true http://www.bkjia.com/PHPjc/875470.html techarticle application of SSI in PHP 1. What is the server-side embedding of SSI: Server Side Include, a server-based Web authoring technology that is class to ASP. Before sending content to the browser, ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.