SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question SSI "exec cgi" with URL parameters?

    I am trying to include a CGI script into an .shtml page. The script uses a parameter in the URL. ?l=1 sets the output to English. ?l=2sets the output to Japanese. My goal is to have two shtml pages, one English and one Japanese, both pulling data from the same script but in the correct language.

    I can get the output in the default language by using the following code in the .shtml page:

    Code:
    <!--#exec cgi="/cgi-bin/script.cgi" -->
    But if I try to add the params at the end like so:

    Code:
    <!--#exec cgi="/cgi-bin/script.cgi?l=1" -->
    I get an error. Is there any way to pull of an include using params? Keep in mind that you are talking to a total CGI/perl noob.

    Thanks!

  2. #2
    SitePoint Wizard bronze trophy KevinR's Avatar
    Join Date
    Nov 2004
    Location
    Moon Base Alpha
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    exec does not pass parameters, use include virtual instead:

    <!--#include virtual="/cgi-bin/script.cgi?l=1" -->

  3. #3
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doh! Thanks KevinR, problem solved.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •