#!/usr/bin/perl use usabcgi; print "Content-type:text/html\n\n"; $idno=$ENV{REMOTE_ADDR}; $idno =~ s/\.//g; $idno =~ tr/0123456789/1357902468/; $idno .= time; print "\n"; print "\n
\nYour comments have been noted.
Thank you for helping us make Greenstone more usable.
\n"; print "View report details | \n"; print "Track report | "; print "\n"; print" |
The information has now been sent, thank-you. The information sent is displayed below. This window will close automatically after 20 seconds."; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/,$pair); $value=~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } if (-e $fileoutloc){ open FILEOUT, (">>$fileoutloc"); } else { open FILEOUT, (">$fileoutloc") or print "cannot open file $fileoutloc\n"; } #print FILEOUT "-------------------------------------\n"; print FILEOUT "report-id := $idno\&usabend;\n"; foreach $key (keys(%FORM)) { if($key eq "URL") { $url = $FORM{$key}; $url =~s/\&/\&\;/g; } print FILEOUT "$key := $FORM{$key}\&usabend;\n"; } print FILEOUT "browser-read-by-server := $ENV{HTTP_USER_AGENT}\&usabend;\n"; print FILEOUT "browser-ip-no := $ENV{REMOTE_ADDR}\&usabend;\n"; print FILEOUT "server-ip-no := $ENV{SERVER_ADDR}\&usabend;\n"; print FILEOUT "time := ".scalar(localtime(time))."\&usabend;\n"; print FILEOUT "----------------------------------------------\n"; close (FILEOUT); print"\n";