#!/usr/bin/perl use CGI qw(-debug :standard :html3); $dtd = "-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"; $class = param("class"); $comment = param("comments"); $animal = param("animal"); # Remove spam if ( ($comment =~ m/URL=/) || ($animal ne 'horse') ){ print header(); print( start_html( { dtd => $dtd, title => "Error!" } ) ); print ( h2({-ALIGN=>"center"}, "Your comments were not recorded, because they appeared to be spam.") ); print end_html(); } else{ print header(); print( start_html( { dtd => $dtd, title => "Thanks!" } ) ); $resultsFile = param("resultsFile"); # print("Results File: $resultsFile\n"); print ( h2({-ALIGN=>"center"}, "Your comments have been recorded.") ); print ( h2({-ALIGN=>"center"}, "Thank You!") ); print( "

"); print( "Click here to read the comments

"); print end_html(); open (OFILE, ">>$resultsFile") || die "Error opening $resultsFile: $!"; print OFILE "

Class: $class

\n"; print OFILE "

$comment\n\n

"; close(OFILE); }