View Full Version : SSI's n' CGI's
Bi4Be
04-27-1999, 08:08 PM
Here's a quickie that I am going to need pretty soon.
Is it possible to call a SSI to execute another CGI within a CGI? Just put in the normal <!--#exec cgi="/cgi-bin/ad.pl" --> ??? I tried that and it didn't work.
In other words, I am trying to replace those two banners at the top of my auction (IE: see http://www.bid4beanies.com/cgi-bin/tatu.cgi?A001 ) with an CGI ad script which uses SSI to execute it. Only thing is I have no idea how to execute a CGI within a CGI.
Thanks :D,
-Bi4Be
PS: I'm lovin' these new UBB modifications! Pretty nifty...
Charles Capps
04-27-1999, 10:36 PM
I don't /think/ there is a way to execute SSIs within CGI - some say it can be done using some twisted conf files...[nbsp][nbsp]I have my doubts.[nbsp][nbsp];)
------------------
"Okay, so I'm not "SANE" so to speak, but uh... I'm the lovable kind of psycho"
http://solareclipse.net/
Justin
04-28-1999, 04:33 AM
If the cgi is outputting content directly (as in, the address bar shows the cgi instead of a generated html file like the UBB), you can put this in the cgi:
$banner = `/path/to/other.cgi`;
print $banner;
This assumes there isn't a variable called $banner already used in the first cgi - just change the name to something you know isn't used. This will cause the other.cgi to execute, and it's output goes in the variable $banner.
Not sure, but you might have to do this:
$banner = `perl /path/to/other.cgi`;
Either way, make sure you give the full path to the banner script.
You might end up with "Content-type: text/html" in with that, and I think it will print... can use regex to eliminate it:
$banner = `/path/to/other.cgi`;
$banner =~ s/Content-type: text\/html\n\n//sg;
print $banner;
Hope this helps:)
------------------
Justin Nelson
FutureQuest Support
Bi4Be
04-28-1999, 06:09 PM
Wow! That worked unbeleivably well! Thanks bunches, Justin! :D
*Happy Happy Joy Joy! Happy Happy Joy Joy!* (Ok, now I'm being weird. But I guess thats I show my deep appreciation *grin*)
-Bi4Be
penelope
04-28-1999, 06:45 PM
That hurt my brain.
Peace,
Penelope
Justin
04-28-1999, 07:41 PM
Glad to be of assistance:)
------------------
Justin Nelson
FutureQuest Support
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.