[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Reading special chars from form input



At 02.05 10/28/97, Michael Ziege wrote:
>I'm working with the module CGI.pm and I'd like to read in form fields with
>special characters like '', '', .. Then I'm generating an e-mail with
>this text. How do I have to treat the query parameters, in order to have it
>sent correctly.

You mean those charcters will be passed to CGI.pm, and you want to get them out properly?  Hm.  MacPerl and CGI.pm recognize those characters fine, but I don't know if the browser transmits them properly.  I don't have anything set up to test right now, but I would suggest using something like the following as a CGI:

#!perl -wl
use Data::Dumper;
use CGI;
$x = new CGI;
print $x->header('text/plain');
print Dumper $x;
print STDERR Dumper $x;

(assuming you have Data::Dumper installed from CPAN or Paul Schinder's site)

Anyway, have your form hit this CGI, and it will just dump the output of your CGI object, and you'll be able to see what the data looks like.  You can run it from within MacPerl, too, and debug it in the MacPerl window.  You enter the CGI parameters as separated by '=' and a return between each one.  Hit CTRL-D when done.  Dumper prints twice to the window, since STDERR and STDOUT are the same window in this case.

(offline mode: enter name=value pairs on standard input)

bergeek=Pudge
othergeek=Franois
Content-type: text/plain


$VAR1 = bless( {
                 '.parameters' => [
                                    'bergeek',
                                    'othergeek'
                                  ],
                 'bergeek' => [
                                 'Pudge'
                               ],
                 '.fieldnames' => {},
                 othergeek => [
                                'Franois'
                              ]
               }, 'CGI' );

$VAR1 = bless( {
                 '.parameters' => [
                                    'bergeek',
                                    'othergeek'
                                  ],
                 'bergeek' => [
                                 'Pudge'
                               ],
                 '.fieldnames' => {},
                 othergeek => [
                                'Franois'
                              ]
               }, 'CGI' );



Just debug like this until you find something ... :-)  Good luck,

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch