in reply to Problem with query string
which prints:use URI; my ($dir, $lang, $des) = qw(DIR LANG DES); # sample my $u = URI->new("agent_site.pl"); $u->query_form( dir => $dir, lang => $lang, des => $des, page => "page=https://www.consumerinfo.com/cic/form_online_a1.asp?sc +=00030000&af=&br=&cl=0105", ); print "$u\n";
Next, if you're including it as part an HTML page (like for a link), you'll need to HTML-escape it, as:agent_site.pl?dir=DIR&lang=LANG&des=DES&page=page%3Dhttps%3A%2F%2Fwww. +consumerinfo.com%2Fcic%2Fform_online_a1.asp%3Fsc%3D00030000%26af%3D%2 +6br%3D%26cl%3D0105
which prints out:use HTML::Entities qw(encode_entities); print encode_entities($u);
Although all of this is actually done for you if you're using CGI.pm, if you generate the link by mucking with the current "param" set. I have an example of that in one of my columns which shows how to generate a "self" url that has modified parameters.agent_site.pl?dir=DIR&lang=LANG&des=DES&page=page%3Dhttps% +3A%2F%2Fwww.consumerinfo.com%2Fcic%2Fform_online_a1.asp%3Fsc%3D000300 +00%26af%3D%26br%3D%26cl%3D0105
-- Randal L. Schwartz, Perl hacker
|
|---|