Google Community
Latest Forums Rules Resources
Custom Search

Go Back   Google Community > Webmaster Forums > Web Design, Coding & Programming Forum

GoogleCommunity Sponsor
Cirtex Hosting
Use coupon "forum" for 50% Off!

Reply
 
LinkBack Thread Tools Display Modes
Old 09-02-2007, 12:57 PM   #1 (permalink)
Junior Googler
 
montyauto's Avatar
 
Join Date: Dec 2006
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
montyauto is on a distinguished road
Thumbs up Is it possible to include header and footer file using HTML

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?
montyauto is offline   Reply With Quote
 
Sponsored Links
Old 09-02-2007, 02:26 PM   #2 (permalink)
Elite Googler
 
alex-party's Avatar
 
Join Date: Oct 2006
Location: Ireland
Posts: 1,085
Thanks: 0
Thanked 2 Times in 2 Posts
alex-party is an unknown quantity at this point
Yes, only with frames, but I would not suggest doing that.
alex-party is offline   Reply With Quote
Old 09-10-2007, 10:52 AM   #3 (permalink)
Senior Googler
 
fjpoblam's Avatar
 
Join Date: Feb 2007
Location: Santa Fe, NM
Posts: 143
Thanks: 0
Thanked 8 Times in 8 Posts
fjpoblam is on a distinguished road
A tempting idea, but...

...yes, I had the same temptation, early in my large website. I noticed, as you are probably noticing, that all the pages have roughly the same header and footer. You can do it easily doing a PHP self-file or a javascript-write imbedded in the "head" and "tail" of each one.

But then, the question pops up, are you doing it for YOUR ease of maintenance? You should, in the end, consider, your visitor's ease of viewing, and bite the bullet, and place the same ol' header and footer, hand-coded or copied and pasted, into each file. Use lots of CSS and place that CSS in one shared external file. It'll speed up the load for each page, in the long run.
fjpoblam is offline   Reply With Quote
Old 09-10-2007, 12:43 PM   #4 (permalink)
Googler
 
Join Date: Dec 2005
Location: Indiana
Posts: 77
Thanks: 0
Thanked 1 Time in 1 Post
MomsBreak
Send a message via ICQ to MomsBreak Send a message via AIM to MomsBreak Send a message via Yahoo to MomsBreak
Quote:
Originally Posted by montyauto View Post
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?
If you are using frontpage 2003 software to build your web site then you only need to look on the help files for page includes. Then you can pull one html file into another html file that runs site wide.

There also a php includes coding you can do.
MomsBreak is offline   Reply With Quote
Old 09-14-2007, 10:05 AM   #5 (permalink)
Googler
 
parusa619's Avatar
 
Join Date: Jan 2007
Location: In my sweetie's heart
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
parusa619 is on a distinguished road
Send a message via Yahoo to parusa619
Quote:
Originally Posted by montyauto View Post
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?
Yes, possible, for now, you can include any files using php codes in HTML. Put this in your .htaccess

PHP Code:
RemoveHandler .html .htm
AddType application
/x-httpd-php .php .htm .html 
Then after that, put your codes in header.txt and footer.txt and do this in each and every page you have
PHP Code:
 <?
include('header.txt');
?>
<!-- content -->
<?
 
include('footer.txt');
 
?>
parusa619 is offline   Reply With Quote
Old 09-14-2007, 11:57 AM   #6 (permalink)
Google Guru
 
intelliot's Avatar
 
Join Date: May 2004
Posts: 2,527
Thanks: 15
Thanked 46 Times in 26 Posts
intelliot has disabled reputation
It's also technically possible to use JavaScript, but this is more hassle than it's worth.

Additionally, if your web server supports it, you can enable SSI parsing of .html files in .htaccess. This will let you use SSI (server-side include) directives in your .html files!
intelliot is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to include header and footer file using HTML montyauto Web Design, Coding & Programming Forum 3 08-28-2007 07:00 AM
Including header file using HTML black-and-white Web Design, Coding & Programming Forum 3 12-27-2006 04:44 AM
Isn't X-HTML like the older version of HTML? ricards All About Google 1 11-17-2005 10:34 AM
Can I put adsense code in a javascript include? eelsource Google AdWords & AdSense Forum 2 01-01-1970 11:33 AM
Isn't X-HTML like the older version of HTML? ricards All About Google 1 01-01-1970 10:08 AM


All times are GMT -8. The time now is 04:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004–2007 Google Community