#!C:/perl/bin/perl.exe use CGI::Carp qw(fatalsToBrowser); use CGI; $query = new CGI; #-------------------------------------------- # Read in CGI data #-------------------------------------------- $v01= $query->param('v01'); $v02= $query->param('v02'); $v03= $query->param('v03'); $pass= $query->param('pass'); #-------------------------------------------- # Check to see if this is the first pass through #-------------------------------------------- if($pass < 1){ $pass=1; } #-------------------------------------------- # Basic Formatting and Style #-------------------------------------------- print $query->header; print $query->start_html(-title=>'page title'); #------------------------ # pass = 4 #------------------------ if($pass == 4){ # get date and time ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year = 1900 + $year; $mon= $mon+1; $hour = $hour - 1; $date1= "$mon/$mday/$year"; $date2= "$hour:$min:$sec"; # write data to text file open(INFO, ">>$ENV{'DOCUMENT_ROOT'}/data/tehdata.txt"); print INFO "$pin,$task,$date1,$date2,$v01,$v02,$v03,$v04,endline\n"; close (INFO); print "Your data have been saved. Thank you for your time.

"; } # end pass = 4 #------------------------ # pass = 3 #------------------------ if($pass == 3){ print "
"; print "Are you (pick one):

into coffee
against coffee


"; print ""; print ""; print ""; print ""; print ""; print "
"; } # end pass = 3 #------------------------ # pass = 2 #------------------------ if($pass == 2){ print "
"; print "Are you (pick one):

a criminal master mind
innocent on all charges


"; print ""; print ""; print ""; print ""; print ""; print "
"; } # end pass = 2 #------------------------ # pass = 1 #------------------------ if($pass == 1){ print "
"; print "Are you (pick one):

home-schooled
a junior in high school
a senior in high school
in another grade
a high-school graduate
not in school
working on a GED


"; print ""; print ""; print ""; print ""; print ""; print "
"; } # end pass = 1 #-------------------------------------------------------------- # for troubleshooting and programming - print all cgi data # set $printAllCGI to 1 to dump the cgi data to the browser window # set $printAllCGI to 0 to hide this dump #-------------------------------------------------------------- $printAllCGI = 0; if($printAllCGI == 1){ print "----------------dump all query -----
"; foreach $key (sort($query->param)){ $value = $query->param($key); print "$key = $value
"; } print "----------------------------
"; } print $query->end_html;