



(11 votes)#!/usr/bin/perl # # getpost.cgi written by detour@metalshell.com # # Get data from a form using the post option # # http://www.metalshell.com/ # print "Content-type: text/html \n\n"; print "<html><body>"; # Get the posted string and seperate the key=value read(STDIN, $qstring, $ENV{'CONTENT_LENGTH'}); @key_value = split(/&/, $qstring); foreach $pair (@key_value) { $pair =~ tr/+/ /; ($key, $value) = split(/=/, $pair); # Convert the % codes too Ascii $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; print "$key = $value"; } print "</body></html>";