Advertisement

12.17.2003 at 11:35PM PST, ID: 20829122
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Include html file in my html page

Tags: include, file
I want to include a html page in my html page. How can i?

All my html pages has a common header so I want to know how to include a html file as header in all my html documents. When I want to update header, i just need to update one file only.

Thanks
Start your free trial to view this solution
Question Stats
Zone: Web Development
Question Asked By: ricjava
Solution Provided By: gam3r_3xtr3m3
Participating Experts: 14
Solution Grade: A
Views: 713
Translate:
Loading Advertisement...
12.18.2003 at 12:44AM PST, ID: 9962819

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2003 at 01:07AM PST, ID: 9962906

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2003 at 03:23AM PST, ID: 9963354

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2003 at 03:31AM PST, ID: 9963378

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2003 at 06:33AM PST, ID: 9964317

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2003 at 07:25AM PST, ID: 9964724

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2003 at 08:59AM PST, ID: 9965504

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2003 at 01:26PM PST, ID: 9975202

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2003 at 09:41PM PST, ID: 9976678

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.20.2003 at 12:10PM PST, ID: 9979196

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.21.2003 at 04:58PM PST, ID: 9982748

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.18.2004 at 07:22AM PST, ID: 10393213

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.18.2004 at 07:28AM PST, ID: 10393273

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.11.2004 at 09:28PM PDT, ID: 10803571

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.17.2004 at 01:35AM PDT, ID: 10848312

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
09.02.2004 at 11:41PM PDT, ID: 11970587

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.25.2005 at 03:48AM PDT, ID: 15153213

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.29.2005 at 01:25PM PDT, ID: 15186078

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
12.18.2003 at 12:44AM PST, ID: 9962819
You would need to use some javascript for this, if a pure html solution is needed.

The js could write the header part of the page using document.write and you could call this js wherever the header need to be in each page.
The same cane be done for footer, left menu, etc so that by changing just these js files the look of the site will change.
 
12.18.2003 at 01:07AM PST, ID: 9962906
Using JS for something like this would be horrid to try and maintain, plus it wouldn't work in browsers that don't support scripting.

A serverside include would be the best solution. SSIs are not difficult to implement, but exact syntax depends on the server. What does your site run serverwise and languagewise?
 
12.18.2003 at 03:23AM PST, ID: 9963354
here's a code using SSI:
SSI (btw, HTML file should be in .shtml and SSI is supported by the server)

<!--#include file="something.html"-->
 
12.18.2003 at 03:31AM PST, ID: 9963378
Also, you could use XML data islands as external file while using JavaScript to access them and like fozylet's comment, worse to worst cases, using document.write() from an external JavaScript file to write contents dynamically on the page.
here's a snipplet:

on the header or anywhere as an example:
--------------------------------------------------
<script language="JavaScript" type="text/javascript" src="external.js"></script>

external.js: (just an example, its not that complicated... lol)
--------------------------------------------------------------------
var str="\<html\>\n\<head\>\n\<title\>Hello!\<\/title\>\n\<\/head\>\n"
document.write(str);
Accepted Solution
 
12.18.2003 at 06:33AM PST, ID: 9964317
 
12.18.2003 at 07:25AM PST, ID: 9964724
<!--#include file="_inc/inc_siteColours.asp" -->
 
12.18.2003 at 08:59AM PST, ID: 9965504
<!--#INCLUDE virtual="/inc/Include_files/anyfile.inc"-->
 
12.19.2003 at 01:26PM PST, ID: 9975202
 
12.19.2003 at 09:41PM PST, ID: 9976678
You might wanna use frame????
 
12.20.2003 at 12:10PM PST, ID: 9979196

Rank: Master

you might NOT want to use frames....
 
12.21.2003 at 04:58PM PST, ID: 9982748
no....i don't want frame
 
02.18.2004 at 07:22AM PST, ID: 10393213
How can I  use variable filename  in my HTMl Page?
 
02.18.2004 at 07:28AM PST, ID: 10393273

Rank: Master

mssabur: If you wish to ask a question, then please do so using the Ask A Question link on a topic page. Please don't try to piggyback your question as a comment on someone else's question.
 
04.11.2004 at 09:28PM PDT, ID: 10803571
you could use php if your server supports it.....or if YOU have it installed.
rename the HTML file your working on..........or rather copy it first and rename the copy         whateverthepagenameis.php
and put the below coding wherever you want the page to be included at
For example to show it at the top put the coding at the very top.........above all your HTML


<?php
include("pagename.html");
php?>

 
04.17.2004 at 01:35AM PDT, ID: 10848312
Bout the only way I can think of to put an html file in a html file is with iframe
ex:
 
09.02.2004 at 11:41PM PDT, ID: 11970587
There is a java solution, and I found it once on the net...but can't find it anymore...
 
10.25.2005 at 03:48AM PDT, ID: 15153213
in html file:

<script src="header.txt">
</script>


in file: "header.txt"

document.write("type your text")
 
10.29.2005 at 01:25PM PDT, ID: 15186078
This is yet another case on EE where the accepted answer is (sadly) not the best one.  The best solutions are either to use PHP (as suggested by zanus123), or to use SSI (as suggested by gam3r_3xtr3m3 and others).

JavaScript is best reserved for scripting, and not includes, since JS is inefficient (each line includes a 'document.write("' preceding and '")' following), and since it is possible to disable JavaScript.  Few users do it, but it's possible.  Use JavaScript only where there's not a better solution.  In this case, PHP and SSI are both simpler.

Some PHP servers may require you to specify the full address:
<?php include('http://mydomain.com/inc/header.txt'); ?>

If you're using FrontPage Extensions, there's yet another way to do includes.  Check your FrontPage help file.  (I recommend against using FrontPage, but if you are...)
 
 
20080236-EE-VQP-29