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

Hello Monks,

I have several SHTML pages, which I want to use SSI's on to include the same perl script, but with different passed values. However, the include bombs when I try:

<!--#exec cgi="foo.cgi?bar=yikes" -->
Does anyone know what I'm doing wrong?

Replies are listed 'Best First'.
Re: Server Side Include
by merlyn (Sage) on Aug 17, 2005 at 18:27 UTC
Re: Server Side Include
by davido (Cardinal) on Aug 17, 2005 at 18:38 UTC

    It's possible that your webserver has been set to disregard execs.

    Also, you can't pass parameters using the exec command, you have to use the include virtual syntax instead if you need to pass a query string.

    Apache webserver docs:

    The include virtual element should be used in preference to exec cgi. In particular, if you need to pass additional arguments to a CGI program, using the query string, this cannot be done with exec cgi, but can be done with include virtual, as shown here:


    Dave

Re: Server Side Include
by atcroft (Abbot) on Aug 17, 2005 at 18:42 UTC
      Rules to remember:
    1. Please review your documentation before asking a question.
    2. Please provide enough information to answer your question when asking.

    I note those two rules not to be hostile, but to show why it is difficult to give you a specific answer to your question. It sounds like you want to do is to set a variable (in this case, "bar") before calling the CGI (in this case, "foo.cgi"). Since you did not include the type of webserver (#2, above), I cannot tell you exactly how this could done, although likely the documentation for the server can do so (#1, above). However, an example of documentation providing such an answer can be found in the Apache 1.x webserver documentation at http://httpd.apache.org/docs/1.3/howto/ssi.html, specifically in the section entitled "Setting variables".

    HTH.