Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTMl includes

Status
Not open for further replies.

nawrioj

Programmer
Feb 14, 2005
22
US
Can we do an include in HTML file ? like including a file containing a navigation code in an HTML file(index.html)

nawrioj
 
You can do it with server-side includes (SSI).

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Do you have any code sample for that ?

nawrioj
 
The file must be saved as a .shtml file for it to include another file.
Code:
<html><head>
<title>Test</title>
</head> 
<body>
 <!--#include virtual ="\index.html"--> 
</body> 
</html>
Hope his helps

Glen
 
And the included file can have ANY extension. Regardless of the extension it will be treated as HTML once it is included. Thus:

Code:
<html><head>
<title>Test</title>
</head> 
<body>
 <!--#include virtual ="/menumap.[b]txt[/b]"--> 
</body> 
</html>
works just as well.

Mike Krausnick
Dublin, California
 
Thanks for the input guys. It helps a lot ^_^

nawrioj
 
Of course, your server must be configured to handle server-side includes (SSI). Check with your ISP or Tech.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Yeah, I noticed that. Thanks for pointing that out. I did try to do a simple includes but it didn't work. I will contact the hosting company and ask them about it

thx,

nawrioj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top