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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Includes 1

Status
Not open for further replies.

TidyTrax

Programmer
Jul 11, 2001
263
AU
Is it possible to source an external piece of html code into your existing code? Like you can with javascript .js file. I have a section that is common to all pages, and thought an external page to be included would be best, can it be done?
 
Yup - if you can use SSI (Server Side Includes).

Your page would have to be called something.shtml (there are other suffixes that might work, depending on how your server's configured) and you would source the external file by

<!--#include virtual=&quot;/external.html&quot; -->

(assuming external.html is in the root of your web site).

An included file can also include more files, providing it's got the .shtml suffix.

As always, there's more than one way of doing this (TM) :) and if you go searching through the forum, you'll find much better answers than mine ;-) TandA

One by one, the penguins steal my sanity.
 
ayjaycee: I don't think you'll find a better answer than that. SSI is the easiest and simplest way to do what TidyTrax wants. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top