sub ParseForm { # Read in form input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); # loop through array and do this.. foreach $pair (@pairs) { # assign variables to the name and respective values ($nome, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding # Translate Plus Signs into a space Character $value =~ tr/+/ /; # Find Hexadecimal #'s (%[][]) then convert it to what it should be $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Allows you to hit enter in the text field $value =~ s/\n//g; # We're using this one. $value =~ s/://g; $value =~ s/&//g; # freaky tab character.... $value =~ s/ / /g; # youre not gettin' in here secret agent man... (Prevent Hackers or DIE) if ($value =~ m///g; # put the info in an associative array $call{$nome} = $value; # end foreach } } sub ParseQuery{ # print "ParseQuery!
\n"; # Find out what the user wants... ($map, $user, $Order) = split("&",$ENV{'QUERY_STRING'}); # Save Query String for later use if need be.. $buffer = $ENV{"QUERY_STRING"}; # Split the name-value pairs @pairs = split(/&/, $buffer); # loop through array and do this.. foreach $pair (@pairs) { # assign variables to the name and respective values ($nume, $value) = split(/-/, $pair); # Un-Webify plus signs and %-encoding # Translate Plus Signs into a space Character $value =~ tr/+/ /; # Find Hexadecimal #'s (%[][]) then convert it to what it should be $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Allows you to hit enter in the text field # $value =~ s/\n//g; # youre not gettin' in here secret agent man... (Prevent Hackers or DIE) $value =~ s///g; # put the info in an associative array $call{$nume} = $value; # end foreach } # foreach $v (sort keys %call){ # print "Parse Query: $v = $call{$v}
\n"; # } } 1;