Skip to main content.
home | support | download

Back to List Archive

help !!!!!

From: <ASA_AZIZ(at)not-real.FRCU.EUN.EG>
Date: Tue Aug 03 1999 - 21:42:50 GMT
Hello ;
      Thank you for replay my ex mail I 'll descripe the problem again .I
downloaded ,compile and run
the swishe program successfully in my Alpha server , then I maintained the
index , well when I put my
perl program in the cgi-bin directory and try to call it from my web server it
gave the error message :

" Server Error

The server encountered an internal error or misconfiguration and was unable to
complete your request.

Please contact the server administrator, and inform them
of the time the error occurred, and anything
you might have done that may have caused the error"

I'll show you my perl program :
   $swish = "/usr/opt/swish/swish-e";

   $swishcgi = "/cgi-bin/";

   $params = " ";

   $index = "/usr/opt/swish/index.swish";

   $organization = "<FONT SIZE=1 COLOR = #0000A0 > Copyrights (c) 1999,2000 
EUN Egyptian Universities Network 

   $department = "<FONT SIZE=1 COLOR=#0000A0 > FRCU Forign Relation
Coordination Unit ,SWISH, All Rights 
Reserved . </FONT>";
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;
    push(@search_tags, $value), next if ($name eq 'search_tags');

    $FORM{$name} = $value
$query = $FORM{'query'};
$results = $FORM{'results'};

if (@search_tags)
     $tags = join("",@search_tags);
     $search_tags = "\-t $tags";
   } else
       $search_tags = "";
 if ($query)
    } else

 sub print_form
 &html_header(" ");
 print <<EOF;

<font color = 0000FF>
<FORM ACTION="$swishcgi" method=post>
<inPUT TYPE="reset" VALUE="Clear"><INPUT NAME="query"  SIZE=30><SELECT
<OPTION value=0> All
<OPTION value=10> 10
<OPTION value=20> 20
<OPTION value=30> 30
<OPTION value=40> 40
<OPTION value=50> 50
<OPTION value=100> 100
</SELECT><INPUT TYPE="submit" VALUE="Search ">
Enter word(s). You can connect terms with <b>and</b> or <b>or</b><br>
Example: disadvantaged and students .<p>


sub search_parse
$count = 0;
open (SWISH, "$swish -w $query -m $results $search_tags -f $index|");

while (<SWISH>)
   if ($_ eq "err: no results")
   {&search_error("There were no items that matched your search request");}

   if ($_ eq "err: could not open index file")
   {&search_error("Could not open SWISH Index File $index");}

   if ($_ eq "err: no search words specified")
   {&search_error("Please Enter at least one Search Word");}

   if ($_ eq "err: a word is too common")
 {&search_error("One of your search terms is too common, please try again");}

  next if /^\D/ ;
  push(@results, $_);
 &html_header("Your Search Results");
    print "<p>\n";
    print "Your Search for <strong>$query</strong>, returned $count Items\n";
    print "<hr><dl><dt>\n";
foreach (@results)

 ($stringone, $title, $filesize) = split(/\"/, $_);
 ($rank, $url) = split(/ /, $stringone);
 print "<dd><a href=\"$url\">$title</a><br>\n";
 print "<dd>Relevancy Score: $rank  Size of Document: $filesize Bytes<p>\n";
print "</dl><P>\n";

sub search_error
 &html_header("Your Search Results");
 $error_message = $_[0];
 print "$error_message\n";

sub html_header
    $document_title = $_[0];
    print "Content-type: text/html\n\n";
    print "<HTML>\n";
    print "<HEAD>\n";
    print "<TITLE>$document_title</TITLE>\n";
    print "</HEAD>\n";
    print "<H3><FONT COLOR =FF0000> $document_title </FONT> </H3>\n";
    print "<hr>\n";


sub html_trailer

print "<P>\n";
print "$organization<br>\n";
print "$department<P></body>\n";
print "</body>\n</html>\n";
Received on Tue Aug 3 13:38:30 1999