#!/usr/bin/perl # Path and name of the Config-file ##################################################################### # # There are no changes nessesary below # ##################################################################### $mailprog = '/usr/lib/sendmail'; # Print out a content-type for HTTP/1.0 compatibility print "Content-type: text/html\n\n" if ($ENV{'GATEWAY_INTERFACE'} ne ''); # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $buffer="$buffer&$ENV{'QUERY_STRING'}"; # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Stop people from using subshells to execute commands # Not a big deal when using sendmail, but very important # when using UCB mail (aka mailx). $value =~ s/~!/ ~!/g; # Uncomment for debugging purposes # print "Setting $name to $value
"; $FORM{$name} = $value; } $ENV{'HTTP_REFERER'}=~ /[^\?]*\?.*query=([^&]*)/ ; $query=$1; #$query=~ /(.*)&/; #$query=$1; print "
\n"; print "