Forum Moderators: phranque

Message Too Old, No Replies

SSI Outside the Server

Can SSI Work Outside the Server Domain?

         

cmarshall

12:54 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Folks,

Maybe this is a stupid question, but I have been told that the only stupid question is the one you don't ask...

I have seen a great deal of discussion about using SSI in place of iFrames.

In my experience, I tried this, and it didn't work. The thing about frames is that they are a complete, self-contained Web page, with context, different validations, etc. You can cram anything, from anywhere, into a frame.

SSI, on the other hand, is an include of an HTML source file. You can use the virtual modifier to execute it as an HTML output, but I have never had success in SSI-ing files from outside the server's domain.

Am I wrong? Is this possible? I would dearly love it to be so. I can't deal with frames, so my answer to the particular conundrum at hand is "can't get there from here."

Is it possible to have an SSI like this?


<!--#include virtual="http://www.someserver.com/index.html" -->

That "http://" part is the killer. I am pretty sure that you cannot SSI off of a server domain for obvious security reasons.

If this is the case, then it is not a reasonable suggestion to say that an <iframe can be replaced with an <!--#include

coopster

1:06 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You are correct in that the URL cannot contain a scheme or hostname, only a path and an optional query string. However, include virtual can be used to include the output of CGI programs into an HTML document. Which means the CGI program could do the work and return the external page for you.

If you are interested in doing more with server-side technology you may want to have a look at some of your options. PHP, for example, makes this real, real easy.

cmarshall

4:49 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm...I must have missed something. I have been using PHP for a long time, but I have not (obviously) explored its use outside of a fairly specific domain.

What would I do to accomplish the following? (This is the specific example of what am not able to do now):


I have a PHP-based database engine that allows searches of a database, and displays the results in a Web page.

If I know that the results were to be displayed as only a part of a Web page (such as in a <div> or a <table><tr><td>), then I would pipe the output from the part of the program that has not had the HTML and template wrappers applied. This could easily be done by having an "embedded=1" flag in the request URI.

If I could do this, then I could provide the DB as a service to other Webmasters who could do a callout to it in their own PHP, and they would not have to use frames.

I can call this from code on the same server (as I do now), but I am not aware of the PHP required to render this code as an HTTP transaction. I will study this later tonight, but I would certainly appreciate any tips.

coopster

5:43 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member




<html><head><title>Title</title></head><body>
<?php
include [php.net] 'http://www.example.com/index.php?embedded=1';
?>
</body></html>

cmarshall

5:48 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wow. It's that simple, eh?
I'll try it out tonight.
Thanks! You've made my day.

jdMorgan

7:41 pm on Jul 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're stuck without PHP (which I agree is superior for this application), then you could always define a local path for the include that is in reality set up as a proxy for the actual, external page. See Apache mod_proxy.

Jim