[thelist] Server Side Includes / Remote host

Warbasse Design - Info info at warbassedesign.com
Thu Jan 15 18:16:14 CST 2004


<TIP>When working with SSI the files must be local for the include to work
i.e. - <!--#include virtual="http://www.mydomain/page1.txt" --> .
This approach, unfortunately, won't work.<!--#include
virtual="http://www.mydomain/page1.txt" --> </TIP>


Hello,

I would like to use server-side includes to serve up advertisements to/on
other peoples sites that support SSI.

I wish to give website owners a simple include that they can drop into their
.html page like :
<!--#include virtual="ad1.txt" -->
as the dir structure above shows - ad1.txt must be on their server for the
include to work.

Ideally, what I would like to do is:
<!--#include virtual="http://www.mydomain/ads/ad1.txt" --> but, as the tip
above indicates, SSI does'nt go for this.

Instead, I have read, that I need to create a simple cgi script that calls a
remote variable
(in my case an image) and use *that* in the include like:
<!--#exec cgi="/cgi-bin/ads/pointer.cgi"-->
I have also tried
<!--#include virtual="/cgi-bin/ads/pointer.cgi"-->

----------------------------------------------

I have tried this code for the actual pointer.cgi script:

#!/usr/bin/perl -w

print "Content-type: text/html\n\n";
use LWP::Simple;
$cgiReturn = get http://www.mydomain/ads/ad1.jpg;
print $cgiReturn;
exit;

#!/usr/bin/perl -w

print "Content-type: image/jpg\n\n";
use LWP::Simple;
$cgiReturn = get http://www.mydomain/ads/ad1.jpg;
print $cgiReturn;
exit;

The result, in each case, is a page that pulls in the code of the image
instead of the image itself.  Any help to get me across the finsh line would
be greatly appreciated.

Thanks,
Phil Warbasse
ClickCall TM enabled websites - www.clickcall.biz



More information about the thelist mailing list