C and S Design.
Search Friendly Programming and Design



Using Server Side Includes

Operating Systems

One important point to note before going further is the different operating systems the webserver may be running on.

What is SSI?

SSI (Server Side Includes) are directives formatted as HTML comments that can be written into HTML documents to run scripts or output results from another page.
While there are several directives in the SSI library the most common use is for dynamically inserting common features such as headers, footer and navigation elements into another page. This can reduce greatly the development time of a website and simplify maintenance and updates.

By creating seperate files for header, footers and navigation which are then included into the page, the whole of the page code can be reduced to a few include directives and should anything require changing on the website, to add new pages or change a logo for instance, only one file has to be edited and the whole site will be updated as soon as the new file is saved or uploaded.

Also it need not stop with the obvious points. Includes can be used for the doctype or a file that has the stylesheet defined could be included which would allow for the CSS file to be changed in all pages at once. This is a big advantage for site development, by giving the developer chance of testing new layouts while having the capabilities to rollback with a single edit.

Using Scripting for Includes

There is a common mis-conception that groups all the various forms of includes under the one title of SSI, This is not strictly correct. SSI actually refers a method where pages can be named with a .shtml extension and the server then processes these files and scans the document for SSI directives. On most servers it is also possible to change the configuration to process other file extensions for SSI directives.

Dynamic Sites and Scripting Technologies

The use of scripting technologies such as ASP or PHP and others, should not strictly be refered to as server side includes as they are scripting methods with much more power and versatility.
For dynamic websites or where any scripting is needed, using server side scripting as includes becomes even more useful and important. Here the entire code library for the site can be condensed into a single include directive. This allows for a code library that can accept "plug-ins". For example; Developing a shopping cart or catalogue website that could handle every possible type of product would be an impossible task. While it can be made as versatile as possible, the same product display page will probably not be suitable for showing everything from clothes to computer spares or jelly moulds to jumbo jets.
The idea of using "plug-ins" allows for a standard code base for the majority of functions and a specialised module can be added to the list to bring in a different database, a module of display routines or a different payment gateway. This makes for a easily customised and versatile system.


Valid HTML 4.01! Valid CSS! copyright © C and S Design 2004 - 2005
Website Design and SE Friendly Coding C and S Design