#!/usr/local/bin/perl $formowner = "perelgut\@interlog.com"; require "ctime.pl"; $Date = &ctime(time); $mailprog = '/usr/ucb/mail'; $recipient = 'perelgut@interlog.com'; # Check that POST method is used if ($ENV{'REQUEST_METHOD'} eq 'POST') { # POST method dictates that we get the form # input from standard input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs on '&' @pairs = split(/&/, $buffer); # Go through the pairs and determine the name # and value for each form variable. foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } # Now all the form variables are in the $FORM # associative array. # Thank the user and acknowledge the feedback # &html_header("Sorry, I Can't Find you in the A-List"); print "Content-type: text/html\n\n"; print "\n"; print "\n"; print "Not on the A-List\n"; print "\n"; print "\n"; print "\n"; print "

Not on the A-List

\n"; print "

\n"; print "


\n"; print "Go Back to the previous page\n"; print "

\n"; print "\n"; print "\n"; print "
\n"; print "

\n"; print "\n

Try the A-List again?

\n"; &html_trailer; } else { # Format the error message for the user. &html_header("Comment Form Error"); print "

\n"; print "Form input was not processed. Please mail your "; print "remarks to $formowner.\n"; &html_trailer; } # ======================================================= # This subroutine takes a single input parameter and uses # it as the and the first level header. # ======================================================= sub html_header { $document_title = $_[0]; print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<HEAD>\n"; print "<TITLE>$document_title\n"; print "\n"; print "\n"; print "

$document_title

\n"; print "

\n"; } # ======================================================= # This subroutine finishes off the HTML stream. # ======================================================= sub html_trailer { print "\n"; print "\n"; }