in reply to Re: CGI-encoded quote characters
in thread CGI-encoded quote characters

If you are already parsing the parameters with CGI it does it automatically.

I tend to do $cgi->Vars() which returns a hash of all parameters to the script. It returns the parameters of the query string if it is a GET or the form if it is a POST. I wrote a little test script:

#!/usr/bin/perl use CGI; my $cgi = new CGI; my %form = $cgi->Vars(); print "Content-type:text/html\n\n"; print "<html><body>\n"; foreach my $key(keys %form) { print "$key = $form{$key}<br>\n"; } print "</body></html>\n"; exit;

I fed it this url:
urltest.cgi?param=%22something%22¶m2=something_else

It printed "something" something_else. The point is that CGI will handle this automatically.

Replies are listed 'Best First'.
Re: Re: Re: CGI-encoded quote characters
by projekt21 (Friar) on Oct 11, 2001 at 13:00 UTC

    If you reread the question, you will see, that Anonymous Monk asked for tips to ENCODE the query string...

    alex pleiner <alex@zeitform.de>
    zeitform Internet Dienste

      Doh!! I thought he wanted to decode it, oh well disregard my above post! :)