Click to See Complete Forum and Search --> : Any alternatives to iframe for integrating content from another site?


rv6eric
12-17-2004, 04:14 PM
I am building a web page where the top banner and footer will be hosted locally, but what is in between it will be coming from another web site. I want all of the content to look like it belongs together and not like part of it is coming from somewhere else. I think the best way to do this is by using an iframe for the content that comes from the other site. I created a test page and it appears to work OK however there are some minor details I will need to work out.

I have read about some drawbacks with iframes so before I commit to going this route, I was wondering if there are other ways for me to do this that might work out better. Let me know if you have any suggestions.

Thanks.

Eric

IncaWarrior
12-17-2004, 04:40 PM
What server side scripting do you have availible?

rv6eric
12-17-2004, 04:56 PM
Perl and PHP are server side script languages, right? It looks to me like I have both of them available from my host. Not sure if I have access to any other server side scripting.

Eric

IncaWarrior
12-17-2004, 05:16 PM
if the other supports it, you could use a server side include. I think there's also a method in php that will get the contents of a page so you could use that too.

rv6eric
12-17-2004, 05:35 PM
I haven't used a server side include before. What is involved? Do you know of a good site with instructions for server side includes?

Is there a way to tell if the content from the other site supports server side includes or is it just a trial and error thing to see if it works?

Thanks for your quick responses.

Eric

rv6eric
12-17-2004, 07:51 PM
Well I have done some searching for information about server side includes and it seems to me that the file being included has to be on the same server for a server side include to work. As I mentioned earlier, I need to display something that comes from another server. It is a product catalog that allows people to drill down to what they are looking for or they can enter search conditions to find what they are looking for.

So, is there a way to do this with server side includes or am I better off going with iframe? I kind of have it working with iframe now. My only problem is that I put the iframe in the middle row of a 3 row table and I can't figure out how to get the row height to adjust to the height of the page coming from the other server.

Eric

Daniel T
12-17-2004, 09:02 PM
I feel I should mention that server-side includes won't work here. If you want to include another site, server-side includes copies the other site exactly, therefore causing you to have 2 <html> tags in your document. Also, the other site would have to have perfect coding in order for it to not screw up your site. The only way to achieve what you want IS with an IFRAME.

Dan

MstrBob
12-17-2004, 10:23 PM
Originally posted by Daniel T
I feel I should mention that server-side includes won't work here. If you want to include another site, server-side includes copies the other site exactly, therefore causing you to have 2 <html> tags in your document. Also, the other site would have to have perfect coding in order for it to not screw up your site. The only way to achieve what you want IS with an IFRAME.

Dan

Well, actually your main issue may be that not all hosts allow the opening of files on different servers.

However, you can easily chop away the incoming code to just what you want, getting rid of all unnecessary tags. Put the file contents into a variable, probably run a RegEx or two, and you could do it.