$redirection = 0; # 1 = Yes; 0 = No
##############
# If you answered 1 to $mail you will need to fill out these variables below:
$mailprog = '/usr/lib/sendmail';
$recipient = 'svanbram@science.widener.edu';
# Get the Date for Entry
$date = `date +"%a, %h %d, 19%y at %T"`;
chop($date);
$shortdate = `date +"%D %T"`;
chop($shortdate);
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# 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
\n";
print "The message section in the form appears to be blank and therefore the message was not sent. Please enter your message below.
\n";
print "
\n";
print "Return to the Email form.\n";
print "\n";
# Log The Error
if ($uselog eq '1') {
open (LOG, ">>$emaillog");
print LOG "$ENV{'REMOTE_HOST'} - [$shortdate] ERR - No Comments \n";
close (LOG);
}
exit;
}
sub no_name
{
print "Content-type: text/html\n\n";
print "No Name\n";
print "
Your name or Email address appears to be blank
\n";
print "The name or Email address sections in the form appear to be blank and therefore your message was not sent. Please add your name and Email address below.