Changeset 3904 for trunk/gsdl/cgi-bin/perl.cgi
- Timestamp:
- 2003-03-19T03:58:00+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/cgi-bin/perl.cgi
r3881 r3904 16 16 $fileoutloc.= "etc/usability.txt"; 17 17 } 18 elsif($line=~/(httpimg)\s+(\S+)/) 19 { 20 $imageloc =$2; 21 if(!($2=~/http/)){ 22 $imageloc="http://".$ENV{HTTP_HOST}."\/".$2; 23 } 24 } 18 25 } 26 27 28 $idno=$ENV{REMOTE_ADDR}; 29 $idno =~ s/\.//g; 30 $idno .= time; 19 31 20 32 if(!($fileoutloc=~/etc\/usability\.txt/)) … … 24 36 25 37 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"; 26 print "<html>\n<head>\n<title> Collected information</title>\n";38 print "<html>\n<head>\n<title>Greenstone Usability Thank you!</title>\n"; 27 39 print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n"; 28 print "<script type=\"text/javascript\">\n"; 29 print "timeleft=21;\n"; 30 print "function timerdisplay(){\n"; 31 print "\tif(parseFloat(navigator.appVersion)>4 && parseInt(timeleft)>0){\n"; 32 print "\t\ttimeleft-=1;\n"; 33 print "\t\ttimeforscreen = timeleft+\' second\';\n"; 34 print "\t\tif(timeleft>1)\{ timeforscreen += \'s\';\}\n"; 35 print "\t\tdocument.getElementById(\'timer\').firstChild.nodeValue=timeforscreen;\n"; 36 print "\t\tsetTimeout(\'timerdisplay()\',1000);\n"; 37 print "\t}\n"; 38 print "}\n"; 39 print "</script>"; 40 print "</head><body onLoad=\"setTimeout(\'window.close()\',20000);timerdisplay();\">\n"; 40 41 $ENV{HTTP_USER_AGENT}=~/([^\/]*)\/([0-9]+\.[0-9]+)/; 42 if(($1 ne "Netscape")||($2 > 4.77)){ 43 print "<style type=\"text/css\">\n"; 44 print "\th1 \{font-family: sans-serif; font-size: 20px}\n"; 45 print "</style>\n" 46 } 41 47 42 48 43 $idno=$ENV{REMOTE_ADDR}; 44 $idno =~ s/\.//g; 45 $idno .= time; 46 print "<h2>Your report ID number is: $idno</h2>"; 47 print "<p>The information has now been sent, thank-you. The information sent is displayed below. This window will close automatically after <span id=\"timer\">20 seconds</span>."; 49 print "<script type=\"text/javascript\">\n"; 50 #print "timeleft=21;\n"; 51 #print "function timerdisplay(){\n"; 52 #print "\tif(eval(document.getElementById != undefined )){\n"; 53 #print "\t\tif(parseInt(timeleft)>0){\n"; 54 #print "\t\t\ttimeleft-=1;\n"; 55 #print "\t\t\ttimeforscreen = timeleft+\' second\';\n"; 56 #print "\t\t\tif(timeleft>1)\{ timeforscreen += \'s\';\}\n"; 57 #print "\t\t\t\tdocument.getElementById(\'timer\').firstChild.nodeValue=timeforscreen;\n"; 58 #print "\t\t\t\tsetTimeout(\'timerdisplay()\',1000);\n"; 59 #print "\t\t}\n"; 60 #print "\t}\n"; 61 #print "}\n"; 62 #print "\n"; 63 print "function viewdetails() {\n"; 64 print "\talert(\"This function is still being researched, please try again later\");\n}\n"; 65 print "</script>"; 66 print "</head><body onLoad=\"if(parseInt(navigator.appVersion)>3)\{window.resizeTo(420,300);\}\" bgcolor=\"#FFFFFF\">\n"; 67 print "<table width=\"400px\"><tr>\n<td><h1>Greenstone Usability - Thank you</h1></td>\n"; 68 print "<td align=\"right\">"; 69 if ($imageloc) { print "<img src=\"$imageloc\/usabbanner.gif\" alt=\"Greenstone koru design\" title=\"Greenstone koru design\">"; } 70 print "</td>\n</tr></table>"; 71 print "<p><a href=\"http://nzdl2.cs.waikato.ac.nz/cgi-bin/dana/library?a=p&p=Usability\" target=\"_blank\">About</a> • <a href=\"http://nzdl2.cs.waikato.ac.nz/cgi-bin/dana/library?a=p&p=Privacy\" target=\"_blank\">Privacy</a>"; 72 print "<p>Your comments have been noted. Thank you for helping us make Greenstone more usable!"; 73 print "<table width=\"400px\"><tr>\n"; 74 print "<td><a href=\"readresults.cgi?$idno\" target=\"_blank\">View report details</a></td>\n"; 75 print "<td><a href=\"http://nzdl2.cs.waikato.ac.nz/dana/gsdl/test.html\" target=\"_blank\">Track report</a></td>"; 76 print "<td align=\"right\"><p><form action=\"\"><input type=\"Button\" value=\"Close Window\" onClick=\"window.close();\"></form></td>\n"; 77 print"</tr></table>\n"; 78 79 80 #print "<h2>Your report ID number is: $idno</h2>"; 81 #print "<p>The information has now been sent, thank-you. The information sent is displayed below. This window will close automatically after <span id=\"timer\">20 seconds</span>."; 48 82 read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); 49 83 @pairs=split(/&/,$buffer); … … 64 98 #print FILEOUT "-------------------------------------\n"; 65 99 print FILEOUT "report-id := $idno\n"; 66 print "<h2>Client information:</h2>\n";67 100 foreach $key (keys(%FORM)) { 68 101 if($key eq "URL") { 69 102 $url = $FORM{$key}; 70 103 $url =~s/\&/\&\;/g; 71 print "<b>$key:</b> $url<br>\n";72 104 } 73 else { print "<b>$key:</b> $FORM{$key}<br>\n"; }74 105 print FILEOUT "$key := $FORM{$key}\n"; 75 106 } 76 print "<h2>Server information:</h2>\n";77 print "<b>browser:</b> $ENV{HTTP_USER_AGENT}<br>\n";78 107 print FILEOUT "browser-read-by-server := $ENV{HTTP_USER_AGENT}\n"; 79 print "<b>Browser IP number:</b> $ENV{REMOTE_ADDR}<br>\n";80 108 print FILEOUT "browser-ip-no := $ENV{REMOTE_ADDR}\n"; 81 print "<b>Server IP number:</b> $ENV{SERVER_ADDR}<br>\n";82 109 print FILEOUT "server-ip-no := $ENV{SERVER_ADDR}\n"; 83 print "<b>Time:</b> ".scalar(localtime(time))."<br>\n";84 110 print FILEOUT "time := ".scalar(localtime(time))."\n"; 85 111 print FILEOUT "----------------------------------------------\n"; 86 112 close (FILEOUT); 87 print "<p><form action=\"\"><input type=\"Button\" value=\"Close Window\" onClick=\"window.close();\"></form>"; 113 88 114 89 115 print"</body></html>\n";
Note:
See TracChangeset
for help on using the changeset viewer.