I'm won't do this as a redirect, but your idea is good - to just add the crucial info to the action string. it's not great, as it's not ok to do it this way in some cases (multiple file upload forms), but for my needs right now it will ensure that i get that field name from the form every time, so i won't be at the mercy of the browser deciding in which order to put my post variables.
your issue of redirection though, that's an odd solution. i think the problem you're trying to solve is that
CGI won't expose variables on the url (GET vars) during a POST. my solution to that is as follows:
my $get_cgi = new CGI( $ENV{REDIRECT_QUERY_STRING} || $ENV{QUERY_STRIN
+G});
my $cgi = new CGI; #will read ALL of STDIN (file uploads will take tim
+e..)
my $all_vars = \%{ $cgi->Vars, $get_cgi->Vars }; #GET vars will take p
+recedence.
the problem with this code is that if you have multiple fields with the same name you lose some values, but if you have that situation you need to build your own hash more explicitly, by calling $cgi->param on each variable until there's nothing left. but this does illustrate my concept: use 2 cgi instances, one for GET and one for POST and merge them
thanks for your insight [id://daitau]
It's not what you look like, when you're doin' what you’re doin'.
It's what you’re doin' when you’re doin' what you look like you’re doin'!
- Charles Wright & the Watts 103rd Street Rhythm Band
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.