require 'cgi-lib.pl'; print &PrintHeader; print "\n"; print " Your Comments \n"; $URL = $ARGV[0]; ($ISSUE = $ARGV[1]) =~ s/_/ /g; ($SECTION = $ARGV[2]) =~ s/_/ /g; ($TITLE = $ARGV[3]) =~ s/_/ /g; $browser = $ENV{'HTTP_USER_AGENT'}; $ipaddr = $ENV{'HTTP_REMOTE_ADDRESS'}; $referer = $ENV{'HTTP_REFERER'}; &ReadParse(*input); #print &PrintVariables(%input); $EMAIL = $input{'email'}; $REALNAME = $input{'realname'}; $USEFUL = $input{'useful'}; $INTERESTING = $input{'interesting'}; $READBYTE = $input{'readbyte'}; $TECHLEVEL = $input{'techlevel'}; $INFONEED = $input{'infoneed'}; $WANTMORE = $input{'wantmore'}; ($TEXTCOMMENT = $input{'textcomment'}) =~ s/\x22/\x27/g; if ( ($USEFUL eq "") || ($INTERESTING eq "") || ($EMAIL eq "") ) { print "

Need a bit more info...

"; print "

"; if ( ($EMAIL eq "") ) { print "

Would you please supply your email address? We want it so that other visitors will be able to respond to your comments. Thanks!"; } if ( ($USEFUL eq "") || ($INTERESTING eq "") ) { print "

Would you please go back and complete the About This Article section on the comment form? Thanks!"; } print "

We're very interested to know who you are and what you think. Thanks for taking the time!

"; } else { print "

Thanks for the feedback!!

"; if ($URL ne "") {print "

Please return me to the article $TITLE";} &LogComments; } print "\n"; sub LogComments { opendir(DIR, "bin/cmt") || print "

Can't open bin/cmt"; $num_comments = -3; # skip ".", "..", and "comments.db" while ($cmt = readdir(DIR)) { $num_comments++; } closedir(DIR); $num_comments++; $num_comments = sprintf("%06d",$num_comments); open(CMT, ">bin/cmt/$num_comments.cmt") || print "

Can't create bin/cmt/$num_comments.cmt"; print CMT "\x22$browser\x22,"; print CMT "\x22$ipaddr\x22,"; print CMT "\x22$referer\x22,"; print CMT "\x22$ISSUE\x22,"; print CMT "\x22$SECTION\x22,"; print CMT "\x22$TITLE\x22,"; print CMT "\x22$USEFUL\x22,"; print CMT "\x22$INTERESTING\x22,"; print CMT "\x22$EMAIL\x22,"; print CMT "\x22$REALNAME\x22,"; print CMT "\x22$READBYTE\x22,"; print CMT "\x22$TECHLEVEL\x22,"; print CMT "\x22$INFONEED\x22,"; print CMT "\x22$WANTMORE\x22,"; print CMT "\x22$TEXTCOMMENT\x22\n"; close CMT; }