in reply to CGI : How to put an "&" into a GET-parameter

HTML::Entities will encode those for you...

I must have been pithed.

  • Comment on Re: CGI : How to put an "&" into a GET-parameter

Replies are listed 'Best First'.
Re^2: CGI : How to put an "&" into a GET-parameter
by diotalevi (Canon) on Jan 28, 2003 at 01:32 UTC

    HTML encoding is different than URI encoding. Ampersand for HTML is & or &. Ampersand for URIs using ASCII encoding is %26.


    Seeking Green geeks in Minnesota

Re: Re: CGI : How to put an "&" into a GET-parameter
by bart (Canon) on Jan 28, 2003 at 14:05 UTC
    So use escape(), from CGI::Util. It comes with, and is also imported into CGI.pm. You can use it as a function, or as a class/object method:
    $escaped = CGI::escape($string); $escaped = CGI->escape($string); $escaped = $cgi->escape($string); # if $cgi is your CGI object
Re^2: CGI : How to put an "&" into a GET-parameter
by Aristotle (Chancellor) on Jan 28, 2003 at 01:56 UTC
    No, he wants to put them in a URL, not on a HTML page. Upd.: doh.. I should refresh before replying.

    Makeshifts last the longest.