Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- #!c:\Perl\bin\perl.exe -w
- ##
- ## [post.cgi]
- ##
- ## Acquiring and formatting raw POST Data
- ##
- print 'Content-type: text/html' . "\n\n";
- read (STDIN, $rawPostData, $ENV{'CONTENT_LENGTH'});
- @rawPostPairs = split /&/, $rawPostData;
- foreach (@rawPostPairs)
- {
- ($key, $val) = split /=/;
- # convert URL-encoded characters
- $val =~ s/%([0-9A-Fa-f]{2})/pack ("C", hex ($1))/eg;
- $key =~ s/%([0-9A-Fa-f]{2})/pack ("C", hex ($1))/eg;
- # replace + sign with space character
- $val =~ s/\+/ /g;
- # assign the value of $val to a variable with the name of the value of $key
- $$key = $val;
- }
- exit;
Advertisement
Add Comment
Please, Sign In to add comment