in reply to CGI scoping question
You have seemed to have left quite a bit out of your description.
but based on what you did say let me propose an explanation. If i expected that
was to give me the value of a cgi parameter called orderby i would expect to see a html section something likemy $index = $q->param('orderby');
But i do not see you posting such a section.<input type="text" name="orderby" value="10" />
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: CGI scoping question
by WoodyWeaver (Monk) on May 10, 2019 at 18:14 UTC | |
This orderby and desc fields are not -- they are being manually set via (The titles on the table lets you sort by that field, and if you click on an already-sorted field it reverses it.) I didn't think that relevant, because its all upstream: at the invocation I'm looking at, the value of orderby is being shown in the $q->Dump output; yet its vanished by the time the first subroutine is called. That is, I've got a print statement, a couple of local assignments, two if's that call listUsers(), a little DB work at the top of sub listusers, and then orderby has vanished. I am assuming there is some sort of global variable passing between CGI instances that I don't know about? ... well, I'm confused. | [reply] [d/l] [select] |
by haukex (Archbishop) on May 10, 2019 at 18:26 UTC | |
I also think you haven't yet provided enough information. I didn't think that relevant To determine what is relevant and what isn't, remove a piece of code. If the problem remains, that piece of code wasn't relevant, if the problem goes away or changes, that piece of code probably was relevant, so keep it in. One of the important aspects of a Short, Self-Contained, Correct Example is that it runs, so that we can download and run the code ourselves to reproduce the problem on our end - you'll get help much quicker this way, and with less guessing :-) Also, in case you're not, Use strict and warnings. | [reply] [d/l] |
by WoodyWeaver (Monk) on May 10, 2019 at 18:47 UTC | |
yet which would have been correct from a previous instance. The CGI:
| [reply] [d/l] [select] |
by Anonymous Monk on May 16, 2019 at 23:47 UTC | |
by tangent (Parson) on May 10, 2019 at 18:33 UTC | |
Several parameters are being set through classical formsIf 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()
| [reply] [d/l] |
by WoodyWeaver (Monk) on May 10, 2019 at 18:57 UTC | |
and produces <!-- variables (index, desc, index_url, desc_url) are (1, , 10, ) -->. The namespace collision did me in. | [reply] [d/l] [select] |