Results 1 to 2 of 2

Thread: Separate files for header and footer

  1. #1
    Join Date
    Mar 2007
    Posts
    1

    Arrow Separate files for header and footer

    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 :


    Code:
    <!--#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 !

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    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=
    Last edited by Wickham; 11 Mar 2007 at 03:53 PM.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. IE Footer Problems
    By azharc in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 24 Feb 2007, 04:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •