Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Execute CGI script from SSI (was: exec cgi problem)

by cal (Beadle)
on Jul 15, 2002 at 14:42 UTC ( [id://181794]=perlquestion: print w/replies, xml ) Need Help??

cal has asked for the wisdom of the Perl Monks concerning the following question:

When I make the call to a browser redirect cgi it returns the correct pages. <!--#exec cgi="/cgi-local/browsr.cgi" -->
index_ns.shtml
index_ms.shtml
index_text.shtml
etc.

How ever. when I try to execute another cgi from within the above returned shtml pages the call below is clearly not returning or executing anything.
<!--#exec cgi="/cgi-local/another.cgi" -->
Any ideas, Thanks
Cal

edited: Wed Jul 17 00:07:12 2002 by jeffa - title change

Replies are listed 'Best First'.
Re: exec cgi problem
by sedhed (Scribe) on Jul 15, 2002 at 16:52 UTC
    Have you tried
    <!--#include virtual="/cgi-bin/somescript.cgi" -->
    or
    <!--#include virtual="/cgi-bin/somescript.cgi?param1=test&param2=3" -- +>
    cheers!
Re: exec cgi problem
by joealba (Hermit) on Jul 15, 2002 at 17:38 UTC
    Does your browsr.cgi script redirect the user to the appropriate .shtml page? Or, does your script actually open the .shtml page and print the HTML code?

    The web server program can only process server-side includes when reading a parsed HTML file. It cannot process SSI's in the HTML output from your CGI script (unless you are using Apache 2.0 with some cool new features -- which I have not had a chance to play with yet).
Re: exec cgi problem
by Aristotle (Chancellor) on Jul 15, 2002 at 16:30 UTC
    I read your question a couple times and thought I understood the question but it kept changing every time I reread. Can you please clarify? Which directive is in which file and where does the browser go when? Also, do you have access to the server's access_log and error_log, and if so what do they reveal?

    Makeshifts last the longest.

Re: exec cgi problem
by little (Curate) on Jul 15, 2002 at 21:15 UTC

    Please ask your webservers admin if
    <!--#exec cgi="/absolute/filesystem/path/to/script" -->
    and
    <!--#exec cmd="/absolute/filesystem/path/to/cmd" -->
    are allowed in SSI. Some providers disable their interpolation or execution due to security concerns.

    If so, there is as it's been already said only the chance of using
    <!--#include virtual="/path/relative/to/your/web_server_root/script" -->
    which is using the GET method so you cannot use POST but can (using SSI 2.0) add the query_string to it alike this

    <!--#include virtual="/path/relative/to/your/web_server_root/script$QU +ERY_STRING" -->

    Have a nice day
    All decision is left to your taste

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://181794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found