Log in

View Full Version : Including header file using HTML



helpless
12-18-2006, 06:07 PM
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?

queerfm
12-18-2006, 06:13 PM
there are many ways to do this, how would you like to do it ifram or include script.

I have both i can post them but don't have access to them

andersmoen
12-18-2006, 08:29 PM
Either you use an <iframe> tag, or you do something much better: PHP :)
The PHP code there is:
<?php
include("yoursite.php");
?>

But if your host won't let you use PHP, you should use <iframe>:
<iframe width="number" height="number" border="0"></iframe>

queerfm
12-18-2006, 09:15 PM
no no no, there is no need for php i use the following code.
works all browsers.

<!--webbot bot="Include" U-Include="header/head.html"
TAG="BODY" -->
and you save page as .html

GhettoT
12-18-2006, 09:47 PM
PHP works in all browsers too.

djr33
12-18-2006, 10:04 PM
But not on all servers. That relies on the server being set to interpret the file like that. If you have PHP, it would work the same way. PHP works in all browsers too... that's because both ways output just html, and the browsers doesn't need to do anything but parse the html... unlike javascript or an iframe tag where the browser actually does it.

I don't know if the OP was even talking about this, though. Do you mean like in word, with a header and footer with titles and such? Not sure how that applies... do you mean when printing? Or?

jscheuer1
12-19-2006, 05:19 AM
no no no, there is no need for php i use the following code.
works all browsers.

<!--webbot bot="Include" U-Include="header/head.html"
TAG="BODY" -->
and you save page as .html

That requires a server with FrontPage extensions enabled and functioning properly.