wampthing Posted May 28, 2005 Posted May 28, 2005 I have been able to successfully use the following: <!--#include virtual="/assets/nav.htm" --> to include pages from within my site. I would like to include a page that is on a second site of mine. I thought it would be as easy as <!--#include virtual="http://www.othersite.com/assets/links.htm" -->. The only problem is it doesn't work. Does anyone know how to do this? again I want to include a file that is held on a second site. Quote
TCH-Bruce Posted May 28, 2005 Posted May 28, 2005 As far as I know you can only use the "include virtual" SSI for content from your own web space. But you should be able to use an iFrame to display the external content. Quote
TCH-Bruce Posted May 28, 2005 Posted May 28, 2005 I did some testing and you can do it with a PHP include ><?php include("http://..."); ?> Quote
surefire Posted May 28, 2005 Posted May 28, 2005 (edited) Depending on the server setup, you might be able to do it with a php include. (As TCH Bruce showed above) Having said that, I wouldn't do it. It will slow down the page load. If that other page doesn't change often, just copy it over to your server and do a regular include. If it changes every so often, then set up a script to read the file, write the contents to a local file, or a database table, and essentially cache the content on your local site. You could set up a cron to update the content as often as you need. This may seem like a lot of extra work, but I really would discourage including an external file if you can. Edited May 28, 2005 by surefire Quote
TCH-Don Posted May 28, 2005 Posted May 28, 2005 Keep in mind for the php include, that if the second site is not yours and they have hotlink protection enabled you will not see images. for an Iframe you might try this ><iframe src="http://www.another-domain.com/folder/file.html" height="550" width="100%" name="Assets" marginwidth=0 marginheight=3 frameborder=0 > If you can see this,<br /> your browser doesn't understand IFRAME.<br /> However, click this <A HREF="http://www.another-domain.com/folder/file.html">link</A> to see the page for Assets.</iframe> <br /> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.