|
Question: What is a server side include? |
|
Answer: Server side includes (SSI)s inserted into an HTML document allow real-time features to be inserted into a web page. |
Server side includes are scanned by the server when you request to see an HTML document. These special tags inserted into the HTML will flag certain information from the server to be inserted into the page as it is sent to your browser. For instance:
| SSI example in red | SSI code |
|---|---|
| today is September 07, 2008 | <!--#config timefmt="%B %e, %Y"--> <!--#echo var="DATE_LOCAL"--> |
| The current time is 19:47:26 |
<!--#config timefmt="%H:%M:%S"--> <!--#echo var="DATE_LOCAL"--> |
| your IP address is 38.103.63.60 | <!--#echo var="REMOTE_ADDR"--> |
| your DNS entry is 38.103.63.60 | <!--#echo var="REMOTE_HOST"--> |
|
this document was last modified on December 21, 2004 |
<!--#config timefmt="%B %e, %Y"--> <!--#echo var="LAST_MODIFIED"--> |
There are several other SSI's in addition to these examples. One of the things that I've used is a SSI to include a common file into another HTML document. If you look at the bottom of all these pages from the Internet Basics 101 site, you probably noticed that the bottom of every page has the same footer. Well - I virtually included that file into all of the other files. If I changed the footer it would change on all of the pages.
8976
| |
© 2004 TRIO | Tutorials | Back to Internet 101 |