Click to See Complete Forum and Search --> : This should be simple


stick076
08-18-2003, 02:48 AM
I'm trying to find an easy way to do this. I have an html file which is a banner and drop down menu that I want displayed at the top of every page on my site. How can I have this "header" load into each of my pages so I only have to update one file? thanks.

AdamGundry
08-18-2003, 02:55 AM
You can do it, but you need a server-side language to do it properly. Using Javascript for this would make your page inaccessible to the 13% or so of users who have JS disabled.

To do it in PHP:
<?php include "header.inc" ?>

To do it in SSI:
<!--#include file="header.inc" -->

Both of the above require the appropriate language installed on your server. It can be done in other languages, such as ASP, if necessary.

Adam

stick076
08-18-2003, 01:29 PM
Ok, I used that SSI script, and it works great in dreamweaver. I uploaded to my site and it doesn't work. I talked with the guy that does the hosting and he says that it is setup to do SSI's. Do I need some other file besides the header.inc file for it to work that dreamweaver plugs in there automatically? Or is it probably on the server side what's wrong? thanks again.

AdamGundry
08-18-2003, 03:37 PM
Yes, you need SSI installed on your server, and you will probably need to rename the file to .shtml so the SSI is parsed by the server.

Here's the documentation if you are using Apache: http://www.netart.it/manual/howto/ssi.html

Adam

stick076
08-18-2003, 04:08 PM
thanks, I did a little research a little bit ago and realized the file extension needed to be .shtml thanks for your help