Navigation
  • Home
  • Recent
  • Most Active
  • Popular
  • Blog
  • Credits
  • RSS
  •   Interaction
  • Register
  • Statistics
  •   Help
  • Suggestions
  • Contact Us
  • How to Edit
  • Help



  • [Edit]


    Server Side Includes or SSI is an easy server-side scripting language used almost exclusively for the web. As its name implies, its primary use is including the contents of a file into another, via a Web Server.
    SSI is primarily used to "paste" the contents of one or more files into another. For example, a file (of any type, .htm, .txt, etc.) containing a daily quote, could be included into multiple SSI Enabled pages throughout a website, by placing the following code
    into the desired pages. With one change of the quote.txt file, pages including the snippet will display the latest daily quote. Server Side Includes are useful for including a common piece of code throughout a site, such as a navigation menu.
    In order for a web server in a default configuration to recognise a SSI-enabled HTML file and therefore carry out these instructions, the file must end with the .shtml extension. SSI files can also end with .shtm but this depends on the servers ability to recognise the extension. It is possible to configure a web server to recognise any file with the .html file extension for server side include processing.


        Server Side Includes
            Basic syntax
            Directives
            A Different View
            The Conventional View
            See also

    top

    Basic syntax
    SSI has a simple syntax: . Directives are placed in HTML comments so that if SSI isn't enabled, users won't see the SSI directives on the page, unless they look at its source.

    top

    Directives
    These are the most common SSI directives:


    top

    A Different View

    According to some, SSIs are all about using script within an .html page. This view states that:
    The methodology of embedding programming languages within HTML is called server-side include and the programming language that is embedded within the HTML is called the scripting language. Netscape's Server-side JavaScript (SSJS), Microsoft's Active Server Pages (ASP), Sun Microsystems' JavaServer Pages (JSP), and open source PHP are examples of server-side includes. They respectively use JavaScript, VBScript (or JScript), Java, and PHP as the scripting language.

    top

    The Conventional View

    The usual view is that SSIs are a handful of standard "directives" placed in an .html page in the form of "SGML" (e.g. standard HTML language) comments. It is old technology, but still useful.

    The directives tell the server to look at the content of the document before sending it to the browser, and to take action if it sees one of these directives.

    The most important directive is the "include" command:

    This causes the server to insert the contents of "myincludefile.html" into the document being processed. It is effectively pasted into the document at the point where the directive is found. The include file may contain additional html commands, style sheets and even additional SSI directives.

    Not all servers permit SSIs. Most Apache servers do. Check with your host first. There may be additional configurations needed to run them. Usually the including document must be named with a ".shtml" suffix, and the server has to be set to permit this.

    One problem with SSIs, from the hosting point of view, is they slow down server processing. Another is that they create certain security concerns.

    top

    See also




     
    Search more:
     

       
    Source Privacy License Download Contact Us Atlas
    Scientus.org Dictionary (Yet Another Wiki) RC : 1.39
    This article is licensed under the GNU Free Documentation License [copyleft]. It uses material from the Wikipedia article "Server Side Includes". link