Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > HTML Programming

HTML Programming Forum discussion covering HTML, XHTML, DHTML and all flavors of HTML. Hypertext Markup Language is used to create websites.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-30-2008, 01:45 PM
SharonB SharonB is offline
Newbie
 
Join Date: Mar 2008
Posts: 3
Rep Power: 0
SharonB is on a distinguished road
Default Including header 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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-30-2008, 03:27 PM
chili5's Avatar   
chili5 chili5 is offline
Guru
 
Join Date: Mar 2008
Location: Canada
Age: 15
Posts: 1,551
Rep Power: 14
chili5 has a spectacular aura aboutchili5 has a spectacular aura aboutchili5 has a spectacular aura about
Send a message via ICQ to chili5 Send a message via AIM to chili5 Send a message via MSN to chili5 Send a message via Yahoo to chili5
Default Re: Including header file using HTML

HTML Code:
<?php
include("header.html");
?>

<?php
include("footer.html");
?>
header.html

HTML Code:
<H1 ALIGN=CENTER>Welcome</H1>
footer.html

HTML Code:
Copyright &copy; 2008
I don't know how to do this without PHP but this should be what your looking for.
__________________
Success is the ability to go from failure to failure without losing your enthusiasm. ~ Winston Churchill
Pictures of England
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-30-2008, 05:40 PM
TcM's Avatar   
TcM TcM is offline
Terminator - I'll be back
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 6,076
Rep Power: 50
TcM is a jewel in the roughTcM is a jewel in the roughTcM is a jewel in the roughTcM is a jewel in the rough
Default Re: Including header file using HTML

That is PHP, not HTML. And I think that is the only way to go, to do this with html you have to use frames, and that's not recommended.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall


Business Directory | Technology Blog | Windows Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-30-2008, 05:52 PM
chili5's Avatar   
chili5 chili5 is offline
Guru
 
Join Date: Mar 2008
Location: Canada
Age: 15
Posts: 1,551
Rep Power: 14
chili5 has a spectacular aura aboutchili5 has a spectacular aura aboutchili5 has a spectacular aura about
Send a message via ICQ to chili5 Send a message via AIM to chili5 Send a message via MSN to chili5 Send a message via Yahoo to chili5
Default Re: Including header file using HTML

I know it's PHP, but itgets the job done, I don't think it's possible with HTML.

You could use frames but that's not recommended.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-30-2008, 11:52 PM
v0id's Avatar   
v0id v0id is offline
Super Mod
 
Join Date: Apr 2007
Location: Denmark
Posts: 1,940
Last Blog:
CherryPy(thon)
Rep Power: 23
v0id is a splendid one to beholdv0id is a splendid one to beholdv0id is a splendid one to beholdv0id is a splendid one to beholdv0id is a splendid one to beholdv0id is a splendid one to behold
Send a message via MSN to v0id
Default Re: Including header file using HTML

You cannot include other files in plain HTML. You can do it using SSI though.
Code:
<!-- my_include_file.html -->
Hello, World!
Code:
<!-- my_main_file.shtml (note the s-) -->
<!--#include file="my_include_file.html" -->
Other content here...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 03-31-2008, 04:58 AM
chili5's Avatar   
chili5 chili5 is offline
Guru
 
Join Date: Mar 2008
Location: Canada
Age: 15
Posts: 1,551
Rep Power: 14
chili5 has a spectacular aura aboutchili5 has a spectacular aura aboutchili5 has a spectacular aura about
Send a message via ICQ to chili5 Send a message via AIM to chili5 Send a message via MSN to chili5 Send a message via Yahoo to chili5
Default Re: Including header file using HTML

Isn't that almost the same thing as using PHP?

Which one would be better PHP includes or SSI?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-01-2008, 12:51 AM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,402
Last Blog:
Object Oriented Design...
Rep Power: 50
John is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of light
Send a message via AIM to John
Default Re: Including header file using HTML

Quote:
Originally Posted by chili5 View Post
Isn't that almost the same thing as using PHP?

Which one would be better PHP includes or SSI?
I believe it does the same thing as your php, but perhaps the server doesn't have PHP enabled in which case using SSI would be the only option [assuming the server allows SSI]
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-05-2008, 07:43 PM
Kaabi's Avatar   
Kaabi Kaabi is offline
Programming God
 
Join Date: Jul 2006
Posts: 884
Rep Power: 13
Kaabi is on a distinguished road
Default Re: Including header file using HTML

I used to use a header and footer on my old website all the time. It makes things a lot easier, with the <php_include> and such.
__________________
Cheap Airsoft Guns

If you are looking for high-quality, yet cheap, airsoft guns, then check out MrAirsoft.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-06-2008, 07:33 AM
Xav's Avatar   
Xav Xav is offline
Guru
 
Join Date: Mar 2008
Location: London, England
Posts: 3,190
Last Blog:
The Windows Registry
Rep Power: 28
Xav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to all
Send a message via MSN to Xav
Default Re: Including header file using HTML

You can'y use PHP unless your site is actually hosted online - if you're just making local pages, then it won't work. Also, some web development software doesn't show it up on the designer.
__________________
Xav, the power of youth
Worship the Creator... not his creations
Web Site | Beta Site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 05-06-2008, 11:44 AM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,402
Last Blog:
Object Oriented Design...
Rep Power: 50
John is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of light
Send a message via AIM to John
Default Re: Including header file using HTML

Quote:
Originally Posted by Xav View Post
You can'y use PHP unless your site is actually hosted online - if you're just making local pages, then it won't work. Also, some web development software doesn't show it up on the designer.
Every piece of php code I have ever written was written and tested locally.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
File Manager Jaan Community Projects 40 02-27-2008 03:45 PM
Header File norman_069 C and C++ 6 09-27-2007 02:38 PM
About HTML Onur Tutorials, Classes and Code 0 08-28-2007 06:13 PM
HTML Introduction clookid Tutorials, Classes and Code 5 01-08-2007 09:43 PM
What is HTML, DHTML and XHTML? Lop HTML Programming 5 08-09-2006 11:00 AM


All times are GMT -5. The time now is 01:55 AM.

Contest Stats

dargueta ........ 128.00000
John ........ 127.00000
Xav ........ 107.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads