#!/usr/bin/perl use CGI qw(:standard); #faster, more legible use CGI::Carp qw(fatalsToBrowser); #Paths $path = "/just/my/path/here/"; $Date = `date`;chop $Date; ######################### $mailProgram = '/usr/lib/sendmail -t -eq'; $recipient = "me\@here.com"; # . $FORM{manageremail}; ######################### Files $logfile = "tempfile_ext.tmp"; $logfileOrig = "logfile_ext.log"; chmod 777, $logfile; chmod 777, $logfileOrig; $message = "Thank you for your edit.
Back to Admin Screen"; $message2 = "Thank you for your submission.
Back to Home";
# Get the input from the form
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/%0D%0A/
/g;
$value =~ s/%09//g;
$value =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
## Grammartize checkbox values
if ($value eq "on") {
$value = $name;
}
$FORM{$name} = $value;
}
my $linenumber = $FORM{linenumber};
#print OUTFILE "Param check $linenumber";
my $currentline = 0;
# Program Logic
&makelog;
&thankyou;
&mailMessage;
&mailMessage2;
# Program Logic done, just subroutines now.
# Print an HTML page with variable data.
sub thankyou {
if ($linenumber){
print "Content-Type: text/html\n\n";
open(THANKS, "thanks.html") || die "thanks.html: $!";
while (