Server Side IncludesSSI is sort of like using your HTML server as a cut and paste editor. Here is basically what happens when your server handles a request for an SSI document. - The server reads the document and renders the requested document
- It looks for the <!--#include directive merges their results into creating a finished document.
- The document is then sent to the client browser.
What is nice about using them, if you maintain a very large site or use the same code over and over. You can put the code in one file and the with one include statement in all other pages include this code. In the unix world, you have to enable the server to do this. In the IIS world, you use the #include directive. Either the files can be .inc, .txt or .asp. I recommend using .asp extension. All stuff is rendered through the asp.dll, then if you have a generic connection string or sensative server side code isn't sent to the client as if it was included in a .inc or .txt file. Basic Syntax If the file you want to include in your page is located some where under your DocumentRoot directory (the one with your main index page), you can use the virtual type of include: Include file in the same directory <!--#include file="file.txt" --> or Include file in the another directory <!--#include virtual="/somedir/file.txt" --> or Include file in the ROOT directory <!--#include virtual="/file.txt" --> for files under the root directory.
|