473,320 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to *include* a file in an html page?

i have many *.html* pages with the same header. i wanted to make one
*header* file and put a link to that file in all html pages. So if i
ever need to make changes in the header, i will need to edit only 1
file rather than all pages.

for *.asp* pages this code works fine:-

<!-- #include file="filename.inc" -->
but the same **include** does not work for *.html* pages. i guess
there is some other way to put a link!
any help appreciated
Jul 19 '05 #1
5 5659
You can use an iFrame, however, I would not reccomend it as it is a little
"cluttery" to say the least.

You'd be best off converting your pages to .ASP and using the #include tag.

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
cooldv <md**@hotmail.com> wrote in message
news:d3**************************@posting.google.c om...
i have many *.html* pages with the same header. i wanted to make one
*header* file and put a link to that file in all html pages. So if i
ever need to make changes in the header, i will need to edit only 1
file rather than all pages.

for *.asp* pages this code works fine:-

<!-- #include file="filename.inc" -->
but the same **include** does not work for *.html* pages. i guess
there is some other way to put a link!
any help appreciated

Jul 19 '05 #2
Tell IIS to treat .html extension as ASP files.

"cooldv" <md**@hotmail.com> wrote in message
news:d3**************************@posting.google.c om...
i have many *.html* pages with the same header. i wanted to make one
*header* file and put a link to that file in all html pages. So if i
ever need to make changes in the header, i will need to edit only 1
file rather than all pages.

for *.asp* pages this code works fine:-

<!-- #include file="filename.inc" -->
but the same **include** does not work for *.html* pages. i guess
there is some other way to put a link!
any help appreciated

Jul 19 '05 #3
You need SSI (Server Side Includes) in some shape.
It depends in the server type (mainly Windows/IIS or Unix/Apache) as well as
on its settings.
You have to ask your ISP.
If they do not support ASP they might support shtml extentions which allow
SSI. The include syntax should be the same as in ASP, but you better check
it at, say
http://www.webcom.com/~webcom/help/inc/include.shtml

Alternatively, if you do noit want to change the files extention you can put
the headings into .js files and output then using Javascript

Yet the cleanest way is, as Steven suggested, switch to ASP (or to PHP if
you are in Apache)

"cooldv" <md**@hotmail.com> wrote in message
news:d3**************************@posting.google.c om...
i have many *.html* pages with the same header. i wanted to make one
*header* file and put a link to that file in all html pages. So if i
ever need to make changes in the header, i will need to edit only 1
file rather than all pages.

for *.asp* pages this code works fine:-

<!-- #include file="filename.inc" -->
but the same **include** does not work for *.html* pages. i guess
there is some other way to put a link!
any help appreciated

Jul 19 '05 #4
On 27 Dec 2003 08:13:02 -0800, md**@hotmail.com (cooldv) wrote:
i have many *.html* pages with the same header. i wanted to make one
*header* file and put a link to that file in all html pages. So if i
ever need to make changes in the header, i will need to edit only 1
file rather than all pages.

for *.asp* pages this code works fine:-

<!-- #include file="filename.inc" -->
but the same **include** does not work for *.html* pages. i guess
there is some other way to put a link!


Okay, I may be stating the obvious, but of course ASP code won't work
in an HTML file. Either rename the HTML file with the ASP extension,
alter IIS to process all HTML extensions as ASP (App Mappings - Dumb
way to do it...), or use SSI and include the file in your HTML code.
You'll need to use a SHTM/SHTML extension to process SSI in IIS, so
you might as well rename the files with an ASP extension to begin
with.

Jeff
Jul 19 '05 #5
thank ya'll Gurus for your help.

i guess i will go with renaming .html files to .asp
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Luke Bellamy | last post by:
Hi - I have been asked to add a hit counter to a standard HTML page. I have found a php script to implement the counter but need to show it on the html page. I cannot include a PHP in the html...
2
by: Greg | last post by:
I'm new to html and web coding, this is a simple one - appreciate your help! I'm attempting to get my browser bar links to reside in a single .asp file to avoid multiple additions to pages when...
2
by: chopper | last post by:
Please excuse the long post but I can't think of shorter way of explaining the issue. Please could someone advise on the following: I'm writing preview functionality for a CMS written in ASP....
21
by: .:mmac:. | last post by:
I have to update a page every week. I get the page ahead of time so I used the "scheduled includes" webbot in Frontpage only to find that I would have to refresh the page every week to have it...
5
by: Tony Strazzeri | last post by:
Hi all, I a fairly new to html and Javascripting. I have been trying to write some code to hide my email address from spam harvesters. I copied the code from various web examples and modified...
6
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
4
by: Jon Slaughter | last post by:
I'm using eval to excute some mixed php and html code but I cannot debug it. I am essentially using filegetcontents to load up a php/html file and then inserting it into another php/html file and...
3
by: =?Utf-8?B?QnJhbmRvbg==?= | last post by:
Hi, I have an aspx page that has the "include" code in it which includes another page that displays information. I also have an upload page that allows users to upload a simple html document...
10
by: lg | last post by:
My site consists of many htm pages and each has a banner with my address and some graphic. Now each html page is something like this: <html> blah blah <div> my logo my address </div>
1
by: yemen2007 | last post by:
hi ever one. i have problem in my html file. i have header file , footer file, and index file. i want compile the header , and footer in the index file use include file put it is not work. this my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.