PDA

View Full Version : How do I include a file using ServerSide Includes?


scoutt
04-04-2002, 08:54 AM
Q. How do I include a file using ServerSide Includes?

A. You need to have the main file index.shtml to have the shtml extension. then on the files you include you don't need the <html><body> tags. The Menu file can be any extension you want.

index.shtml
<html>
<head>
<title></title>
</head>
<body>
<table>
<!-- #include file="menu.txt" -->
<td></td>
<td></td>
</tr></table>
</body>
</html>

menu.txt
<tr>
<td>
<p><a href="link1.html>link 1 </a></p>
<p><a href="link2.html>link 2 </a></p>
<p><a href="link3.html>link 3 </a></p>
<p><a href="link4.html>link 4 </a></p></td>

pixelmonkey
04-04-2002, 11:52 AM
if your SSI pages are not showing but on your homepage, try this...

address them virtually with (this style of include works on most NT / IIS 4 servers)
<!--#include virtual="footer.html"-->

depending on the servers configuration this might take some time, as it may require an additional / and or ..

<!--#include virtual="/footer.html"-->
<!--#include virtual="../footer.html"-->

Starting simple with a few test pages on the server is the best way to adapt your site and yourself to how the SSI is configed on your server.

chris<pixelmonkey>:monkey:

Tham
02-14-2006, 04:01 PM
Then once you have mastered SSI, you can write programs that will write stuff from forms to your included file, and then you have a message board that will keep your webpage layout exactly the same!