473,569 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5672
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.c om> wrote in message
news:d3******** *************** ***@posting.goo gle.com...
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.c om> wrote in message
news:d3******** *************** ***@posting.goo gle.com...
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.c om> wrote in message
news:d3******** *************** ***@posting.goo gle.com...
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.co m (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
2115
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 file can I? the web server will not pre-parse a html file correct? I would like to put the PHP hit counter on the web site that only contains html...
2
2137
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 I add a page to the site. I've done a lot of reading and surfing, believe I know how to do it, but can't get it to work. I've installed IIS on...
2
1644
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. Currently, when a page is published (physical file created in the website) it contains include directives to pull in commonly used bits of HTML and...
21
1899
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 work. That is silly, it should run by itself. so... I asked the question in the FP group and I was offered this pseudocode to do it by month which...
5
1854
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 it to suit me. The code to generate the address is in a js include file. I am using frontpage 2003 to create my web pages. My problem is that the...
6
2106
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file = ...\includes\StaffingHeaders.inc -->" </Script> <%=ClientName%> ****************************************************************************
4
3370
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 then using eval to execute the final product. If I were to use include and output buffering instead of filegetcontents would it allow be to...
3
4905
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 onto the server. The include code calls that html page to display the text on that page. The problem is when the user uploads that html page, the aspx...
10
7767
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
2234
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 code.so plz hellp me this inside the footer.html <a href="contact_info.html">Contact Us</a> <a href="copyright_info.html">Copyright &copy;...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.