PDA

View Full Version : Separate files for header and footer



siteNewbie
11 Mar 2007, 01:08 PM
Hi all,
all of my site's pages have the same headers and footers, so I want to use two separate files - one for the header and one for the footer.
I think it can be done using :



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

and by renaming all the pages to the .shtml suffix.

What else should I do, because right now it's not working.

Plz Help !

Wickham
11 Mar 2007, 03:26 PM
It should work if your host supports SHTML (and PHP and other server-side includes) - cheaper hosting packages and ISP free webspaces do not; except that I don't know if virtual works. I use #include file=.

Instead of an html file as the included file, try just the header code (no doctype, html tag, head section or body tags, just the code cut from a complete html file and replaced with
<!--#include file="header.txt"-->

note .txt file extension.

See
http://www.wickham43.net/serversideincludes.shtml

Edit:
http://httpd.apache.org/docs/1.3/howto/ssi.html
"Including a standard footer" says that you can use file= or virtual=