Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: How do you pass info to perl through an SSI call on a web page?

( #185609=categorized answer: print w/ replies, xml ) Need Help??

Q&A > CGI programming > How do you pass info to perl through an SSI call on a web page? contributed by sedhed

In this case, there could be a few things that would cause that error:

  • The script could not be found. Try using the full path to /var/www/cgi-bin/config.pl or wherever. (In apache at least, you can start the path "/" at the document root, or "/cgi-bin/config.pl" in other words.
  • The script was found, but did not return a proper header. This, in turn, can be caused by either by the script not compiling, or of course by the script running just fine, but never actually printing a header. Be sure your program prints a CGI->header() or "Content-Type: text/html\n\n" line.

Once you get the script to run, you can pass parameters to it by using the #include virtual style of SSI, like so:

<!--#include virtual="/cgi-bin/somescript.cgi?param1=test&param2=3" -- +>

blokhead is correct, the server needs to recognize the html file as server-parsed, for which the normal convention is a .shtml extension. Sounds like you're already there though, because the "an error occurred while processing this directive" message embedded in your html page means the server tried to run your script, but couldn't, as stated above.

Hope this helps.

Cheers!

Comment on Answer: How do you pass info to perl through an SSI call on a web page?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-12-25 15:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls