I know everyone says the only stupid question is the one nobody asks, so here it goes:
can server side inlcudes be called from with a .cgi script. my host requires that i name all files that need SSI to end in .shtml But i have a .cgi script(perl) that i want to call a banner with(in case you havent caught on the banner is called via SSI) You guys have been great in the past and i can't wait to hear from you.i'm pretty sure the anwser is no. However, there are codes you can include that will run the files from your script.I have to agree with hacker, in this situation it will probably not work, but give it a try and see what happens.
You can also do as hacker suggested, use PERL to open the file and display the banner. There are also PERL snippets that can open and display random banners if thats what you need. Here is a listing to check <!-- m --><a class="postlink" href="http://www.perlarchive.com/guide/Banner_Rotation/">http://www.perlarchive.com/guide/Banner_Rotation/</a><!-- m -->
Regards,
kevinok, it was a no go. i am currently learning PHP but i know next to nothing about perl. how do i call a cgi script from another cgi script? thanks again.Ok I'm just learning perl but you could try this. Other people that know perl please review it to make sure it's correct. this is a very simple little thisbut you should back up the script you are changing. Also this will only work for HTML files not really for banner rotating Here it is:
Make a file called what ever you want. It must be .cgi though.
In this file put the following
--------------------
#Start
#Create A SUB. You can name this whatever you want
sub links {
print qq~
HTML Goes here
~;
1;
#end
Put in this somewhere near the top:
require "path_to_script/whatever.cgi";
Then in the place you want the file to appear put:
&links
Now I did not test this but it should work.
Good Luck,
PaulI forgot to specify. If you are taking this out of a script simply in the require loaction put the path to the script and put this
&subname
Where ever you want the sub to appear.Originally posted by Insyder16
can server side inlcudes be called from a .cgi script. i have a .cgi script(perl) that i want to call a banner with
the solution to this i know, but it's not hitting me right now, it likely will before lunch is over.
i will get you an answer to this!
chris<pixelmonkey>:monkey:I didn't notice you needed one for a banner rotator, must be very early in the morning. Anyway what program do you use.
Pauli think i understood that. i will back up the script and then try that. it seems right though from what i've seen of perl. also, i use a script from cgi.resourceindex.com , it was free and a guy that helps me with my site used it on his old site. it works great, it's simple but does it's job. offers some nifty features though, like limit the number of times displyed, disply only on certain pages, weighting and all that goodness.Like I said it won't work well as a banner rotation. What was the script name of the banner rotation you are using.
PaulI told you it would hit me sooner or later!
what you can do is create a page that is woohoo.shtml and do the include for the banner rotation and the other cgi BOTH on the one page!
looking something like this...
<body>
<!--#include file="something.shtml"-->
<!--#exec cgi="/cgi-bin/Ultimate.cgi" -->
</body>
HAHAHAHAHA!
i knew there was a way around it!
chris<pixelmonkey>:monkey:Originally posted by pixelmonkey
I told you it would hit me sooner or later!
what you can do is create a page that is woohoo.shtml and do the include for the banner rotation and the other cgi BOTH on the one page!
looking something like this...
<body>
<!--#include file="something.shtml"-->
<!--#exec cgi="/cgi-bin/Ultimate.cgi" -->
</body>
HAHAHAHAHA!
i knew there was a way around it!
chris<pixelmonkey>:monkey:
There is one problem with this. If the script is supposed to do something like get information from a form or many other things this method won't work.
PaulOriginally posted by hacker
There is one problem with this. If the script is supposed to do something like get information from a form or many other things this method won't work.
Paul
true, so how about seeing some code and re-writing it so both of the scripts are ran as one?
there has to be a way around this!
chris<pixelmonkey>:monkey:For to scripts to run us one all you have to do is put:
require "whaterver.cgi";
and than when you want to use subs from that script put:
&sub_name
Good Luck,
PaulWhat about adding this to your .htaccess? Wouldn't this tell the server to parse .cgi files as well? Then all you need to do is put the SSI call in the output of your CGI.
AddType text/html .cgi
AddHandler text/x-server-parsed-html .cgi
Me Thinks,
Jeremy
can server side inlcudes be called from with a .cgi script. my host requires that i name all files that need SSI to end in .shtml But i have a .cgi script(perl) that i want to call a banner with(in case you havent caught on the banner is called via SSI) You guys have been great in the past and i can't wait to hear from you.i'm pretty sure the anwser is no. However, there are codes you can include that will run the files from your script.I have to agree with hacker, in this situation it will probably not work, but give it a try and see what happens.
You can also do as hacker suggested, use PERL to open the file and display the banner. There are also PERL snippets that can open and display random banners if thats what you need. Here is a listing to check <!-- m --><a class="postlink" href="http://www.perlarchive.com/guide/Banner_Rotation/">http://www.perlarchive.com/guide/Banner_Rotation/</a><!-- m -->
Regards,
kevinok, it was a no go. i am currently learning PHP but i know next to nothing about perl. how do i call a cgi script from another cgi script? thanks again.Ok I'm just learning perl but you could try this. Other people that know perl please review it to make sure it's correct. this is a very simple little thisbut you should back up the script you are changing. Also this will only work for HTML files not really for banner rotating Here it is:
Make a file called what ever you want. It must be .cgi though.
In this file put the following
--------------------
#Start
#Create A SUB. You can name this whatever you want
sub links {
print qq~
HTML Goes here
~;
1;
#end
Put in this somewhere near the top:
require "path_to_script/whatever.cgi";
Then in the place you want the file to appear put:
&links
Now I did not test this but it should work.
Good Luck,
PaulI forgot to specify. If you are taking this out of a script simply in the require loaction put the path to the script and put this
&subname
Where ever you want the sub to appear.Originally posted by Insyder16
can server side inlcudes be called from a .cgi script. i have a .cgi script(perl) that i want to call a banner with
the solution to this i know, but it's not hitting me right now, it likely will before lunch is over.
i will get you an answer to this!
chris<pixelmonkey>:monkey:I didn't notice you needed one for a banner rotator, must be very early in the morning. Anyway what program do you use.
Pauli think i understood that. i will back up the script and then try that. it seems right though from what i've seen of perl. also, i use a script from cgi.resourceindex.com , it was free and a guy that helps me with my site used it on his old site. it works great, it's simple but does it's job. offers some nifty features though, like limit the number of times displyed, disply only on certain pages, weighting and all that goodness.Like I said it won't work well as a banner rotation. What was the script name of the banner rotation you are using.
PaulI told you it would hit me sooner or later!
what you can do is create a page that is woohoo.shtml and do the include for the banner rotation and the other cgi BOTH on the one page!
looking something like this...
<body>
<!--#include file="something.shtml"-->
<!--#exec cgi="/cgi-bin/Ultimate.cgi" -->
</body>
HAHAHAHAHA!
i knew there was a way around it!
chris<pixelmonkey>:monkey:Originally posted by pixelmonkey
I told you it would hit me sooner or later!
what you can do is create a page that is woohoo.shtml and do the include for the banner rotation and the other cgi BOTH on the one page!
looking something like this...
<body>
<!--#include file="something.shtml"-->
<!--#exec cgi="/cgi-bin/Ultimate.cgi" -->
</body>
HAHAHAHAHA!
i knew there was a way around it!
chris<pixelmonkey>:monkey:
There is one problem with this. If the script is supposed to do something like get information from a form or many other things this method won't work.
PaulOriginally posted by hacker
There is one problem with this. If the script is supposed to do something like get information from a form or many other things this method won't work.
Paul
true, so how about seeing some code and re-writing it so both of the scripts are ran as one?
there has to be a way around this!
chris<pixelmonkey>:monkey:For to scripts to run us one all you have to do is put:
require "whaterver.cgi";
and than when you want to use subs from that script put:
&sub_name
Good Luck,
PaulWhat about adding this to your .htaccess? Wouldn't this tell the server to parse .cgi files as well? Then all you need to do is put the SSI call in the output of your CGI.
AddType text/html .cgi
AddHandler text/x-server-parsed-html .cgi
Me Thinks,
Jeremy