#!/usr/local/bin/perl push(@INC,"/usr/local/etc/httpd/cgi-bin"); require("cgi-lib.pl"); &ReadParse; $crlf="\r\n"; print "content-type: text/html$crlf$crlf"; @httpdenv = ( REMOTE_ADDR, REMOTE_HOST, ); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $date = sprintf("%02d/%02d/%02d %02d:%02d:%02d",$year,$mon+1,$mday, $hour,$min,$sec); $total=$in{'total'}; for($x=1; $x<=$total; $x++) { $q[$x]=$in{"q$x"}; $req[$x]=$in{"tr$x"}; if (($q[$x] eq "") && ($req[$x] eq "1")){ print "ERROR"; print "

You didn't enter an answer to question $x. Go back and answer each of the questions.

\n"; exit; } } print "results of input"; print "

Thanks for your time!

\n"; open (LOG, ">>gen.log"); print LOG "$date\t $ENV{REMOTE_HOST}\t"; for ($x=1;$x<=$total;$x++){ $q[$x]=~ s/\t/ /g; $q[$x]=~ s/\n/ /g; $q[$x]=~ s/\r/ /g; print LOG "$q[$x]\t"; } print LOG "\n"; close (LOG);