#!/usr/bin/perl
print "Content-type:text/html\n\n";
#http://xxrainxx.tripod.com/cgi-bin/mboard.html test page
#http://xxrainxx.tripod.com/cgi-bin/postall.txt text file
open (INF,"postall.txt") or dienice("Couldn't open postall.txt for reading: $!");
$subject = $ENV{'QUERY_STRING'};
$subject =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$subject =~ tr/_/ /;
@b = ;
close (INF);
print <<"EndHTML";
$subject
\n
$ENV{'QUERY_STRING'}\n
$subject\n
Here's the message:\n
\n
\n
EndHTML
print "$subject this is what I'm looking for
\n";
for ($x=1;$x < scalar @b;$x++) {
if($b[$x]=="***Begin $subject"){
while ($b[$x]!="***Begin Here***\n"){
print "$b[$x]
\n";
$x = $x + 1;
}
}
}
#foreach $line (@b){
# chomp($line);
# print "$line
\n";
#}
# I removed a section of html when posting because last time closing the textarea broke the preview text field.
sub dienice {
my($msg) = @_;
print "Error
\n";
print "$msg;\n";
}