Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: CGI scoping question

by tangent (Parson)
on May 10, 2019 at 18:33 UTC ( [id://1233574]=note: print w/replies, xml ) Need Help??


in reply to Re^2: CGI scoping question
in thread CGI scoping question

Several parameters are being set through classical forms
...
This orderby and desc fields are not
If you are sending a form to your script then the parameters in the URL are not available to CGI's param(). You need to use url_param()
my $index = $q->url_param('orderby');

Replies are listed 'Best First'.
Re^4: CGI scoping question
by WoodyWeaver (Monk) on May 10, 2019 at 18:57 UTC
    (Bows head) Fascinating, and an issue I would not have guessed. http://127.0.0.1/id/bin/example.pl?exec=list&table=users&orderby=10 has lines
    my $index_url = $q->url_param('orderby'); my $index = $q->param('orderby'); my $desc_url = $q->url_param('desc'); my $desc = $q->param('desc');
    and produces <!-- variables (index, desc, index_url, desc_url) are (1, , 10, ) -->. The namespace collision did me in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1233574]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 00:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found