#!/bin/perl ###################################################################### # ONLY EDIT THIS PART OF THE SCRIPT!!!! $postpage = "http://www.w8zr.net/eztuner/"; $postname = "EZ-Tuner Discussion Group"; $postpath = "/export/home/g/ga/garlanjc/public_html/postings.htm"; $cgilocation = "http://unixgen.muohio.edu/~garlanjc/post.cgi"; $mailprog = '/bin/mail'; $youmail = 'w8zr@arrl.net'; $yourname = "Jim Garland W8ZR"; $getdate = "/bin/date"; # DO NOT EDIT BELOW THIS LINE!!!! ##################################################################### # Get Date and Time from Server $date = `$getdate +"%B %d, %Y"`; chop($date); # Receive info from Posting read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s///g; $value =~ s/<([^>]|\n)*>//g; $INPUT{$name} = $value; } # Give error message to left out categories &no_name unless $INPUT{'name'}; &no_post unless $INPUT{'post'}; # Write info to Post Page open (FILE,"$postpath") || die "Can't Open $postpath: $!\n"; @lines = ; close(FILE); # Open Link File to Output open (POST,">$postpath") || die "Can't Open $postpath: $!\n"; foreach $line (@lines) { if ($line =~ //) { print POST ("\n"); print POST ("$INPUT{'name'}
\n"); if ($INPUT{'email'}) { print POST ("$INPUT{'email'}
"); } print POST ("$date
\n"); print POST ("$INPUT{'post'}


\n"); } else { print POST ("$line"); } } close (POST); # Send info to you open (MAIL, "|$mailprog $youmail"); if ($INPUT{'email'} =~ /(.*)@(.*)/) { print MAIL "From: $INPUT{'name'} <$INPUT{'email'}>\n"; } else { print MAIL "From: $INPUT{'name'}\n"; } print MAIL ("Subject: Posting\n\n"); print MAIL ("$INPUT{'name'} has posted a message to the EZ-Tuner Discussion Group.\n\n"); print MAIL ("You can send response email to $INPUT{'email'}\n\n"); print MAIL ("Here is the new posting:\n\n"); print MAIL ("$INPUT{'name'}\n"); if ( $INPUT{'email'} ){ print MAIL ("$INPUT{'email'}\n"); } print MAIL ("$date\n"); print MAIL ("----------------------------------------------------------\n\n"); if ($INPUT{'post'}) { print MAIL ("$INPUT{'post'}"); } close (MAIL); # Send info to visitor if ($INPUT{'email'}) { if ($INPUT{'email'} =~ /(.*)@(.*)/) { open (MAIL, "|-") || exec $mailprog,$INPUT{'email'} || die "Can't open $mailprog!\n"; print MAIL ("From: $yourname <$youmail>\n"); print MAIL ("Subject: Posting\n\n"); print MAIL ("$INPUT{'name'},\n\n"); print MAIL ("Thank you for posting to the EZ-Tuner Discussion Group. Return to the EZ-Tuner website at $postpage\n"); print MAIL ("You can email W8ZR at $youmail.\n\n"); print MAIL ("Thanks again!\n"); close (MAIL); } } &follow_up; # Error Messages sub no_name { print ("Content-type: text/html\n\n"); print ("No Name\n"); print ("

Your Name appears to be blank

\n"); print ("You didn't add your name so your entry was not posted.\n"); print ("Please add your name below.
\n"); print ("
\n"); print ("Your Name:
\n"); print ("
\n"); print ("\n"); print ("
\n"); print ("\n"); exit; } sub no_post { print ("Content-type: text/html\n\n"); print ("No Posting\n"); print ("

Your Posting appears to be blank

\n"); print ("You didn't post anything so your entry was not added.\n"); print ("Please add your posting below:
\n"); print ("\n"); print ("\n"); print ("
\n"); print ("
\n"); print ("
\n"); print ("\n"); exit; } # Print Follow Up HTML sub follow_up { print ("Content-Type: text/html\n\n"); print ("Thank You\n"); print ("

Thank You For Posting to the EZ-Tuner Discussion Group.

\n"); print ("Your posting follows:

\n"); print ("$INPUT{'name'}
\n"); if ($INPUT{'email'}) { print ("$INPUT{'email'}
\n"); } print ("$date


\n"); if ($INPUT{'post'}) { print ("$INPUT{'post'}
\n"); } print ("Back to $postname.
\n"); print ("If you do not see your addition, hit RELOAD

\n"); print ("Back to the EZ-Tuner Home Page. \n"); exit; }