|
Web Design > Server Side Includes Server-side includes are directives that can be placed in your HTML file, telling the web server to include additional information in the displayed document. This feature is most often used to display the size of a file before downloading, or the date last modified of the current document. In addition, you can use the include element to insert common header files, or trailer files, in your web documents. You can then change the header file and the trailer file without changing all the documents that include them. Enabling SSI If your web document contains SSI directives you must use one of these methods to enable SSI.
<!--#element attribute=value attribute=value ... --> The value will often be enclosed in double quotes; many commands only allow a single attribute-value pair. Here are some typical examples that use the echo element:
<!--#echo var="date_local" --> <!--#echo var="remote_host" --> <!--#echo var="remote_user" --> Using include will allow you to include the content of another file into your current document. For example, if we wanted to include an email address and a copyright notice at the bottom of all of our web pages, we could create a file named footer.html that contained this information and "include" it into all of our pages. If the email address changes, or we wish to add something else to the footer in the pages on our site, we only have to change the content of one file instead of every page very efficient and convenient. At the bottom of each of our pages we would put <!--#include virtual="/acis/ourpages/bits/footer.html" -->
An attribute, using either "virtual" or "file," defines the location of the file we want to include:
|
