#!/usr/bin/perl print "Content-type: text/html\n\n"; if ($ENV{'REQUEST_METHOD'} =~ /get/i) { $buffer = $ENV{'QUERY_STRING'}; $method = "Get"; } else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $method = "Post"; } print "\n"; print "Query Results\n"; print "\n"; print "

Query Results

\n"; print "

(Spill my Guts)

\n"; print "

Method: $method

\n"; print "
\n";

@nvpairs = split(/&/, $buffer);
foreach $pair (@nvpairs)
{
    ($name, $value) = split(/=/, $pair);

    $name  =~ tr/+/ /;
    $name  =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

    print "$name = $value\n";
}
print "
\n"; print "\n";