Question:

Help with html 'includes' file.

by  |  earlier

0 LIKES UnLike

How do you create and what is the syntax of an html 'includes' file?

I want to put a header and a footer file in my includes file and then call my header and footer from my html pages. How can I do that? How do I call it?

Thank you.

 Tags:

   Report

2 ANSWERS


  1. Be sure to set up your .htaccess file to allow Server Side Includes (SSI) if you haven't already done so.  How to do this for your server is probably in the Knowledge Base Q & A on your hosts site under Support.  Some require users to log in for access to this.

    For using all include files (header/footer) that reside in the SAME directory as the *.shtml files using them, use:

    <head>

    <!--#include file="header.html" -->

    </head>

    <body>

    Main content here.

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

    </body>

    For those files outside the directory where the include files reside use:

    <!--#include virtual="/header" -->

    and

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

    respectively in the same places on your pages.

    Ron


  2. Here is a good tutorial about it:

    http://www.boutell.com/newfaq/creating/i...

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions