WebBuilder101 - Making the web happen!
Need Web Dev software? Here is the place to
Flash Point
How to include a SSI

By Eddy R.
10/13/99

Server Side Includes are instructions within web pages that cause the server to insert a file or other information into an HTML document. SSI are mostly used for items that appear on many pages and that have to be updated constantly (such as navigation bars, news updates, etc.)

Here is how to include a SSI in your web pages.  

Create the file to be included

For out example, we'll update the navigation bar throughout a web site.

Open your HTML or text editor (Notepad) and write the HTML that is to be included in your web page. The HTML should only have the code you want it to appear on the web page(s). Also, tags such as <body> or <html> should not be included in the HTML. Here is an example of what the HTML in this file would look like:

<a href="http://www.webbuilder101.com>Webbuilder101.com</a>

As you may have noticed, there are no <body> or <html> tags. Once you finish writing the HTML, save the text file as "nav.html".

Include it

You can include the "nav.html" yourself or you can let your HTML Editor include it for you.

To include the file as a SSI, you must write the following code:

<!--#config virtual="nav.html"-->

Note that this code should be included on every page of your web site where you want the navigation changes to take effect. The HTML in the file that is to have the SSI should look something like this:

<html>
<body>
Check out this link:
<!--this is where the SSI code goes-->
<!--#include virtual="nav.html"-->
</body>
</html>

Note that the file extension of the web page that has the SSI must be .shtml. This extension is necessary because that way, the server knows it's dealing with SSI.

.

 

More Resources
HTML Editors
What is HTML
Server Side Include
Dynamic Sites
How to create a text file

Suggested Reading

Beginning Active Server Pages 3.0
JavaScript Bible
Red Hat Linux
Dreamweaver 3.0
HTML Bible



Download WB101 Wallpaper
• Web Builder 101 Wallpaper Get it!.
• Find out how to create your own Wallpaper Teach me!.
Sign up for our Newsletters
• Web Building Sign me Up!.
• Net Alert! Sign me Up!.
Need Help?
• Contact Support Click here.
• E-mail the Webmaster Click Here.
• Search Tips Click Here.

Webbuilder101.com © 1998 - 2003 Copyright and Terms of Use
Send mail to: webmaster@webbuilder101.com

» About » Support

» FAQ » What's New » MyLog

Web Builder 101 Web Builder 101 - Making the Web Happen Web Builder 101 - Making the Web Happen
.