#!/bin/perl
# This program copied from COOLWEB P198 and modified lightly
$mailer = '/usr/lib/sendmail'; # mailer program
$recipient = 'fcfhsp';
# print the frst part of the return stuff
print "";
print "
Thank you for your entry";
# get user std information from standard input (server)
read(stdin,$buffer,$ENV{'CONTENT_LENGTH'};
# split the name value pairs into a dynamically allocated array
@info = split(/&/,$buffer);
for each $pair (@info)
{
($name, $value) = split(/=/,$pair);
# extract the % encoded info and the '+' to ' ' mapping
$value =~ s/%[a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
# asve it in data array
$DATA{$name} = $value
}
open (MAIL, "|$mailer $recipient" ) || die "Can't start $mailer!\n";
print MAIL "Subject: Submission to Chicken Road\n\n";
print MAIL "Reply-to: $data{ 'Who_Are_You' } sent:\n";
print MAIL "$DATA{'Who_Said_It'}";
print MAIL "$DATA{'Explanation'}";
close (MAIL)
print "
Back to the chicken road page!"
print ""