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!

How to pull one webpage into another? 2

Status
Not open for further replies.

snowyej

Technical User
Nov 26, 2001
69
0
0
US
Ok, this may sound like a strange question (or maybe not..), but I have a website that has a contents bar on the left side. I used CSS for the styling, not frames. So anytime I need update something in that contents bar, I have to edit every single page.

Is there a way (maybe with the <link> tag?) that I can put the contents info in a separate doc and pull that info into my other docs? That way I'd only have to change one document and all the others would automatically update.

Please help! This would make my life so much easier! :)

Thanks in advance,

Elizabeth :)
 
'Includes' will solve this. Includes are made by creating framesets, using an 'iframe', or scripting with PHP, ASP or Java.

An include simply includes info from another file/datasource into your HTML page.

The simplest way for a newcomer to includes to pull this off is with the iframe tag.
 
The trouble with <iframe>s is that they only work in IE. Pity, 'cos they're really useful.

A browser-independent way of doing this, without any scripting, is to use Server Side Includes (SSI). Including a line like this in your page:

[tt]<!--#include virtual=&quot;/menu.txt&quot; -->[/tt]

The server will replace it with the contents of menu.txt before serving the page. This is just scratching the surface of what can be done with SSI, see for more.

There are a couple of caveats though. Some ISPs (especially free ones) do not allow SSI as it places extra load on the server. Also, servers are often set up to require pages to bear the extension .shtml in order to parse for SSI instructions. The above link discusses these issues. -- Chris Hunt
Extra Connections Ltd
 
I forgot another type of include - - SWF files. You could create a menu system with that and call the same 'menu.swf' file on every page.

iframes are used in more than IE. ChrisHunt may be referring to old Netscape browsers. . . . but who cares about old Netscape users?
 
Thanks guys! I'm looking into SSI right now (and maybe SWF too). Maybe I'll get that working. Thanks again for the help and suggestions! I appreciate it!

Elizabeth :)
 
Chris, the include worked great! And it was so easy to implement! The thing I didn't like about iframes was that I had to do so much configuring to get it to look seemless in my page. The include didn't need any configuring at all.

Thanks again to both of you!

Elizabeth :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top