#!/usr/local/bin/perl5 $file1 = "/home/rstcyr/datafiles/SINCYRITYfeedback"; $file2 = "/home/rstcyr/datafiles/SINCYRITYfeedback2"; # Get input read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); @input = split(/=/,$in); $input = @input[1]; # Change "+" to spaces and hex to ascii $input =~ s/\+/ /g; $input =~ s/%(..)/pack("c",hex($1))/ge; $yowsa = 0; # Things to do if feedback was submitted if ($input ne "") { # Open file and read into HTML $yowsa = 1; open (INSERTNEW, ">$file1"); print INSERTNEW "


$input\n"; open (OLDSTUFF, $file2); while () { print INSERTNEW $_; } close (INSERTNEW); close (OLDSTUFF); # Send mail message regarding status $sendmail = "/usr/lib/sendmail"; $FileTo = "stcyr69\@yahoo.com"; open (EMAIL, "|$sendmail $FileTo"); print EMAIL "To: $FileTo\n"; print EMAIL "From: feedback\@saintcyr.com\n"; print EMAIL "Reply-To: feedback\@saintcyr.com\n"; print EMAIL "Subject: SINCYRITY Feedback\n"; print EMAIL "\n\n"; print EMAIL "You've got guest comments!"; print EMAIL "\n\n\"$input\""; print EMAIL "\n\n$ENV{'HTTP_USER_AGENT'}"; print EMAIL "\n$ENV{'REMOTE_ADDR'}"; print EMAIL "\n\nhttp://www.saintcyr.com/rich/PhotoGallery/guest.cgi"; close (EMAIL); } # Start HTML form print "Content-type: text/html\n\n"; print<<"print_tag"; Thanks for Your Comments


print_tag # 'Yowsa' variable allows you to show different content for when feedback has # been entered or not yet entered. '0' is for when page is first shown, and # '1' is for after feedback was submitted. if ($yowsa == 0) { # Put special image here, perhaps? } elsif ($yowsa == 1) { } print<<"print_tag";

print_tag if ($yowsa == 0) { print<<"print_tag"; Please leave your impressions of this site.


print_tag } # Open file and read into HTML open (COMMENTS, $file1); open (COMMENTS2, ">$file2"); while () { print $_; print COMMENTS2 $_; } close (COMMENTS); close (COMMENTS2); print<<"print_tag";


Gallery Main Page
print_tag