Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Passing multiple parameters to a CGI script?

by bassplayer (Monsignor)
on Sep 14, 2005 at 21:15 UTC ( [id://492023]=note: print w/replies, xml ) Need Help??


in reply to Passing multiple parameters to a CGI script?

You'd be wanting to change your link from index.cgi?page=edit;cont=content to index.cgi?page=edit&cont=content since the ampersand(&) is the delimiter you are looking for.

As far as doing something with the parameters in your script, I recommend Ovid's CGI course.

Update: Per InfiniteSilence's reply below, you can keep your parameters delimited by semi-colon(;). (Thanks, IS, for the new knowledge!) If you are still unsure as to how to proceed after reading chas's reply and consulting Ovid's CGI course, you might post more of the code you've tried, which is much more likely to elicit specific assistance.

bassplayer

Replies are listed 'Best First'.
Re^2: Passing multiple parameters to a CGI script?
by InfiniteSilence (Curate) on Sep 14, 2005 at 21:21 UTC
    You are not required to use ampersands to delimit variables if your script is using the CGI module. From the CGI perldoc:

    -newstyle_urls Separate the name=value pairs in CGI parameter query strings w +ith semicolons rather than ampersands. For example: ?name=fred;age=24;favorite_color=3 Semicolon-delimited query strings are always accepted, but wil +l not be emitted by self_url() and query_string() unless the -newstyle_urls pragma is specified. This became the default in version 2.64.

    Celebrate Intellectual Diversity

      I'm using the standard functions of CGI (use CGI qw(:standard);), and attempting to use
      $queryvariable = new CGI; $variable=$queryvariable->param('param');
      to get the parameters. How would I link to the cgi file, and be able to use multiple parameters?
        Usually when you import the standard functions, it is because you are using the function oriented, not the object oriented style. With the latter, you don't need to import :standard. I'm unclear about what you mean by "use multiple parameters". You can get the values of any parameter names using param('name'), and you can get all the names returned as a list if you wish by using param().
        chas

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://492023]
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: (6)
As of 2024-04-19 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found