Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Multiple params (sub DebugCGI101

by Anonymous Monk
on Jan 20, 2018 at 23:49 UTC ( [id://1207608]=note: print w/replies, xml ) Need Help??


in reply to Multiple params

Like choroba says it should work, but,

What webserver are you using (mapache moo.A.1245?? ) What CGI.pm are you using?

Hehehe, CGI.pm, never ceases to confuse :) delete this stuff from your program

### use CGI qw(:standard); ## REMOVE MYSTERY CODE ### use CGI 'param'; ## REMOVE MYSTERY CODE

Then try this program in your browser and see what you get

#!/usr/bin/perl -- use strict; use warnings; use CGI; my $store = CGI->new; my $cell = $store->param('cell'); my $target_dir = $store->param('target_dir'); print $store->header; print $store->escapeHTML( $cell ); print '<hr>'; print $store->escapeHTML( $target_dir ); print '<hr>'; DebugCGI( $store); exit 0; sub DebugCGI { my( $cgi ) = @_; $cgi ||= CGI->new; binmode STDOUT, ':encoding(UTF-8)'; $cgi->charset( 'UTF-8' ); print $cgi->header( -charset => 'UTF-8' ); print $cgi->start_html, $cgi->b( rand time, ' ', scalar gmtime ), '<table border="1" width="%100"><tr><td>', $cgi->Dump, '</td>', '<td><div style="white-space: pre-wrap; overflow: scroll;">', $cgi->escapeHTML( DD( $cgi ) ), '</div></td></tr></table>', CGI->new( \%ENV )->Dump, $cgi->end_html; } ## end sub DebugCGI sub DD { require Data::Dumper; return scalar Data::Dumper->new( \@_ )->Indent( 1 )->Useqq( 1 )->D +ump; } ## end sub DD __END__

Take special note of the value of QUERY_STRING

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-05-21 22:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found