Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: CGI fails to urlencode & chars in outbound url's

by projekt21 (Friar)
on Jun 12, 2002 at 16:27 UTC ( #173910=note: print w/replies, xml ) Need Help??


in reply to Re: Re: CGI fails to urlencode & chars in outbound url's
in thread CGI fails to urlencode & chars in outbound url's

But that's exactly what nobody wants, as the & of & is treated as parameter delimiter.

#!/usr/bin/perl -w use strict; use CGI; my $q = new CGI; print $q->header; print "<pre>\n"; print $_, "=", $q->param($_), "\n" for $q->param; print "\n</pre>\n";
prints
foo=bar amp= baz=
for
http://electra.igd.fhg.de/cgi-bin/test3.pl?foo=bar&amp;baz
but it should print
foo=bar&baz
You need to use CGI::escape or URI::Escape but not CGI::escapeHTML.

Update: Just for completeness: a() calls CGI::Util::make_attributes on each attribute, the latter calls CGI::Util::simple_escape for escaping ("&"->"&amp;" and some others). CGI::Util::escape does something different (see my last post).

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2021-04-17 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?