#!/usr/bin/perl $redirect_to = "http://psych.fullerton.edu/mbirnbaum/decisions/thanks.htm"; $path_to_datafile = "/DataFiles/"; use CGI; $query = new CGI; #timestamp the submission ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $mon++; #determine the data filename, open and dump data $filename = $query->param('00exp'); open(INFO, ">>$path_to_datafile/$filename.data"); foreach $key (sort($query->param)) { $value = $query->param($key); #filter out "'s and ,'s $value =~ s/\"/\'/g; $value =~ s/,/ /g; if ($value !~ /^pf/) { print INFO "\"$value\", "; } else { # filter out items that need to be expanded at submission time pf* if ($value =~ /^pfDate/) { print INFO "\"$mon/$mday/$year\", "; } if ($value =~ /^pfTime/) { print INFO "\"$hour:$min:$sec\", "; } if ($value =~ /^pfRemote/) { print INFO "\"",$query->remote_addr(),"\", "; } if ($value =~ /^pfReferer/) { print INFO "\"",$query->referer(),"\", "; } } #print "$key:$value"; } print INFO "\"complete\"\n"; close (INFO); print $query->redirect($redirect_to); exit();