in reply to How to use cgi param() to read unescaped url parameters

Update: Modified nearly wholesale given understanding granted by other posts

So, tests done on a generic Perl CGI engine:

http://bhmk.com/cgi-bin/testcgiparm.pl?file=test%3bfoo=2848
      Parameter    Value
file test;foo=2848

http://bhmk.com/cgi-bin/testcgiparm.pl?file=test;foo=2848
      Parameter    Value
file test
foo 2848

http://bhmk.com/cgi-bin/testcgiparm.pl?file=test&foo=2848
      Parameter    Value
file test
foo 2848

http://bhmk.com/cgi-bin/testcgiparm.pl?file=test\;foo=2848
      Parameter    Value
file test\
foo 2848

So I'm afraid I don't understand the problem.

The CGI script which generated this these results is behind the readmoretag below.

#!/usr/bin/perl use strict; use CGI; { my $query = CGI::new(); my @frmprm = $query->param; my $prmcnt = @frmprm; print "Content-Type: text/html\n\n"; print "<HTML>\n"; print "<TITLE>Perl CGI Parameter Test Script Results</TITLE>\n"; print "<BODY>\n"; print "<P><FONT SIZE=\"+2\" FACE=\"Arial\"><B>Perl CGI Parameter +Test Script Results</B></FONT>\n"; print "<P>You have successfully launched the Perl CGI Parameter t +est.\n"; print "<P>\n"; print " <TABLE>\n"; print " <TR>\n"; my $spntxt=' '; if ($prmcnt) { my $spncnt = $prmcnt + 1; $spntxt = " ROWSPAN=$spncnt"; } print " <TD$spntxt >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>\n"; if (!$prmcnt) { print " <TD VALIGN=TOP ALIGN=LEFT>\n"; print " <I>(No parameters were passed)</I>\n"; print " </TD>\n"; } else { print " <TD ALIGN=LEFT VALIGN=TOP><B><U>Parameter</U></ +B></TD>\n"; print " <TD$spntxt >&nbsp;&nbsp;</TD>\n"; print " <TD ALIGN=LEFT VALIGN=TOP><B><U>Value</U></B></ +TD>\n"; foreach my $frmprm (@frmprm) { my $prmval = $query->param($frmprm); print " </TR>\n"; print " <TR>\n"; print " <TD VALIGN=TOP ALIGN=LEFT><TT>$frmprm</TT> +</TD>\n"; print " <TD VALIGN=TOP ALIGN=LEFT><TT>$prmval</TT> +</TD>\n"; } } print " </TR>\n"; print " </TABLE>\n"; print "<P>User your browser BACK button to return.\n"; print "</BODY>\n"; print "</HTML>\n"; } exit; __END__

Replies are listed 'Best First'.
Re^2: How to use cgi param() to read unescaped url parameters
by invader7 (Initiate) on Nov 01, 2013 at 12:01 UTC
    My problem is that i send an email with this link : http://bhmk.com/cgi-bin/testcgiparm.pl?file=test;foo=2848 When i open the mail at thunderbird it works, when i open the mail at hotmail (chrome) it makes it http://bhmk.com/cgi-bin/testcgiparm.pl?file=test%3bfoo=2848 and then it doesn't work !!
      Just for kicks, try sending it with the ampersand instead of the semicolon and see what happens.