in reply to How to pass more parameters to a CGI program than inputs in an HTML page?

Well, by definition, the only way a sgi program can receive parameters is via a fields within a pair of <FORM> </FORM> tags. These are coded as INPUT, SELECT or TEXTAREA fields. Now, if what you are wanting is to have some values that you set on the form, but the user cannot see and (normally) change, then you can use hidden fields:
<FORM ACTION="/cgi-bin/formprocess.perl" METHOD="post"> <INPUT TYPE="hidden" NAME="formtype" VALUE="testform"> . . . . </FORM>
Now along with other parameters that CGI.pm will retreive, there will be a parameter "formtype" with a value of "testform".
  • Comment on Re: How to pass more parameters to a CGI program than inputs in an HTML page?
  • Download Code

Replies are listed 'Best First'.
Re: Re: How to pass more parameters to a CGI program than inputs in an HTML page?
by dws (Chancellor) on Feb 22, 2001 at 06:45 UTC
    That's not quite correct. You can pass extra parameters, but you'll need to use the URL, and will have to do some extra processing by hand. For example, arrange to post a form to http://www.example.comx/foo.cgi/extra/params/here The parameters (along with the CGI name) will be available to the script in $ENV{PATH_INFO}.

    This trick works on both Apache and IIS.

      Just the same, you could add an extra arg on the end of the cgi request:
      http://www.example.com/foo.cgi?param1=foo&param2=bar&extrasneakyextrap +aram=foobar
      This assumes that the cgi does no sanity checking on args it recieves.

      BlueLines

      Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.
        Oh? Have you tried this with CGI.pm? And did you figure out why it didn't work?