Script code:
if ($ENV{'REQUEST_METHOD'} eq 'GET')
{$buffer=$ENV{'QUERY_STRING'};
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$str{$name} = $value;}}
There is my problem, i want using =~tr function change + to %2B ,
but i can't do it, under is my trying ,
if ($str{'name'}=~tr/+/%2B/) {print "Hello $str{'name'}\n\n";exit;}
when i input C++ inside the HTML form text field then run it....
the result is give me Hello C%%
anotherway i try to using \ front of the %2B ,that means is
if ($str{'name'}=~tr/+/\%2B/) {print "Hello $str{'name'}\n\n";exit;}
oh, it still print the result is Hello C%%
Somebody can teach me using which function to modify this script can be
change + to %2B of the $str{$name} on my case???
Thank
if ($ENV{'REQUEST_METHOD'} eq 'GET')
{$buffer=$ENV{'QUERY_STRING'};
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$str{$name} = $value;}}
There is my problem, i want using =~tr function change + to %2B ,
but i can't do it, under is my trying ,
if ($str{'name'}=~tr/+/%2B/) {print "Hello $str{'name'}\n\n";exit;}
when i input C++ inside the HTML form text field then run it....
the result is give me Hello C%%
anotherway i try to using \ front of the %2B ,that means is
if ($str{'name'}=~tr/+/\%2B/) {print "Hello $str{'name'}\n\n";exit;}
oh, it still print the result is Hello C%%
Somebody can teach me using which function to modify this script can be
change + to %2B of the $str{$name} on my case???
Thank