Fixed a slight problem involving the script not searching for anything.
authorMatthew Thiffault <mthiffau@csclub.uwaterloo.ca>
Wed, 11 Mar 2009 04:54:50 +0000 (00:54 -0400)
committerMatthew Thiffault <mthiffau@csclub.uwaterloo.ca>
Wed, 11 Mar 2009 04:54:50 +0000 (00:54 -0400)
library/index.cgi

index 94334d8..7c0e8d8 100755 (executable)
@@ -14,9 +14,9 @@ print "Content-type: text/html\n\n";
 $in = $ENV{'QUERY_STRING'};
 
 @pairs = split(/[&=]/,$in);
 $in = $ENV{'QUERY_STRING'};
 
 @pairs = split(/[&=]/,$in);
-%fields = @pairs;
-chomp(%fields);
-$webroot = "../../..";
+%field = @pairs;
+chomp(%field);
+$webroot = "..";
 
 print <<END;
 
 
 print <<END;
 
@@ -76,7 +76,7 @@ foreach $item (@items){
 print "<br><br><br>\n";
 
 #display the search form
 print "<br><br><br>\n";
 
 #display the search form
-if($fields{'do'} eq "home" || $fields{'do'} eq ""){
+if($field{'do'} eq "home" || $field{'do'} eq ""){
 
 #isbn,title,authors,year,edition,publisher 
 
 
 #isbn,title,authors,year,edition,publisher 
 
@@ -116,7 +116,7 @@ END
 }
 
 #query the database
 }
 
 #query the database
-if($fields{'do'} eq "query"){
+if($field{'do'} eq "query"){
 
     print "<h3>Search Results</h3>";
 
 
     print "<h3>Search Results</h3>";
 
@@ -131,15 +131,15 @@ if($fields{'do'} eq "query"){
     $orterm = undef;
     @results;
     @oresults;
     $orterm = undef;
     @results;
     @oresults;
-    $title = $fields{'title'};
+    $title = $field{'title'};
     $title =~ s/[';:"]/ /g;
     $title =~ s/[';:"]/ /g;
-    $publisher = $fields{'publisher'};
+    $publisher = $field{'publisher'};
     $publisher =~ s/[';:"]/ /g;
     $publisher =~ s/[';:"]/ /g;
-    $edition = $fields{'edition'};
+    $edition = $field{'edition'};
     $edition =~ s/[';:"]/ /g;
     $edition =~ s/[';:"]/ /g;
-    $year = $fields{'year'};
+    $year = $field{'year'};
     $year =~ s/[';:"]/ /g;
     $year =~ s/[';:"]/ /g;
-    $isbn = $fields{'isbn'};
+    $isbn = $field{'isbn'};
     $isbn =~ s/[';:"]/ /g;
 
     if($title){
     $isbn =~ s/[';:"]/ /g;
 
     if($title){