View Full Version : Including header file using HTML
masjana.liza
November 15th, 2007, 08:21 AM
Is it possible to include a header and footer file using HTML? I have my file as a .html and need to be able to include the HTML for the header and footer. Anyone know how I can do this?
sammix
November 15th, 2007, 09:28 AM
What I did was to save the html file as *.php and then use the php include function to call the required files. I'm not sure if you can use php inside the html file.
sansimian
November 15th, 2007, 09:37 AM
you want to have your head and footer files as html, then the page you want to include them in as a php file and use the include function.
If you want to keep it all as html then use Iframes, but it's not as good.
aldomatic
November 15th, 2007, 11:58 AM
^ that would work, just make sure your host supports PHP.
simplistik
November 15th, 2007, 03:01 PM
Well... you could also use SSI you don't HAVE to use the PHP method (there's still various other server-side languages besides PHP too). SHTML files are supported by any Apache machine, and is usual turned on by default. If you wanted to go that route to include a file all you have to do is label your document .shtml and use this coding
<!--#include file="header.html" -->
sansimian
November 16th, 2007, 05:05 AM
Well... you could also use SSI you don't HAVE to use the PHP method (there's still various other server-side languages besides PHP too). SHTML files are supported by any Apache machine, and is usual turned on by default. If you wanted to go that route to include a file all you have to do is label your document .shtml and use this coding
<!--#include file="header.html" -->
I forgot about that, my imediate first thought was php, good call. :)
simplistik
November 16th, 2007, 10:12 AM
I forgot about that, my imediate first thought was php, good call. :)
:lol: yea it's forgetable that's for sure :lol:. Not the method I recommend, but it is always an option.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.