Skip to main content.
home | support | download

Back to List Archive

Search Error

From: webmaster <webmaster(at)not-real.deadseabeauty.net>
Date: Tue Dec 10 2002 - 02:39:08 GMT
 Hello,

 I am running Swish on a Win98 Se box.  Everything so far has been =
working, up until I integrate swish with a CGI front.
I used the program that came with swish, search.cgi.  This is what mine =
looks like:

################################
=3Dpod

    If this text is displayed on your browser then your web server
    is not configured to run .cgi programs.

 =3Dcut
>
>     use strict;
>     use CGI;
>
>     my $swish_binary =3D "C:/swish/swishe.exe";
>
>     my $q =3D CGI->new;
>
>
>     print $q->header,
>           header(),
>           $q->start_form,
>           '<p><center>',
>           $q->textfield(
>                 -name       =3D> 'query',
>                 -size       =3D> 40,
>                 -maxlength  =3D> 60,
>           ),
>           ' &nbsp; ',
>           $q->submit,
>           '</center><p>',
>           $q->end_form;
>
>     show_results( $q ) if $q->param('query');
>
>     print footer();
>
>    =20
> #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> sub show_results {
>     my $q =3D shift;
>
>     my $query =3D $q->param('query') || '';
>
>     for ( $query ) {
>         s/^\s+//;
>         s/\s+$//;
>         tr/\0//d;
>     }
>
>     return unless $query;
>
>
>     my $pid;
>
>     if ( $pid =3D open( SWISH, '-|' ) ) {
>         my @rows;
>
>         while (<SWISH>) {
>
>             next unless /^\d/;
>             chomp;
>
>             my ($rank,$url,$title,$size) =3D split /::/;
>
>             my $link =3D $q->a({ href =3D> $url}, ($title || 'no title') =
> );
>
>             push( @rows,
>                     $q->td( {align=3D>'right'}, $rank ) .=20
>                     $q->td( {align=3D>'left'}, $link ) .
>                     $q->td( {align=3D>'right'}, $size )
>             );
>         }
>         if ( @rows ) {
>             print '<h2 align=3Dcenter>Found: ',
>                   scalar @rows,
>                   (scalar @rows > 1) ? ' hits' : ' hit',
>                   '</h2>';
>
>             unshift @rows, $q->th(['Rank','Title','Length']);
>             print $q->table({align=3D>'center'}, $q->Tr( \@rows ) );
>         } else {
>             print '<h2 align=3DCENTER>Failed to find any results</h2>';
>         }
>     } else {
>         unless ( defined $pid ) {
>             print "<h2 align=3DCENTER>Failed to Fork: $!</h2>";
>             return;
>         }
>
>
>         exec $swish_binary,
>             '-w', $query,
>             '-d','::';
>
>         die "Failed to exec '$swish_binary' Error:$!";
>     }
> }
>
> sub header {
>     return <<EOF;
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
>
> <html>
> <head>
>     <title>SWISH-Enhanced</title>
>     <link href=3D"style.css" rel=3Dstylesheet type=3D"text/css" =
> title=3D"refstyle">
> </head>
>
> <body>
>
>     <h1 class=3D"banner">
>         <img src=3D"../images/swish.gif" alt=3D"Swish Logo"><br>
>         <img src=3D"../images/swishbanner1.gif"><br>
>         <img src=3D"../images/dotrule1.gif"><br>
>         <img src=3D"../images/swish2.gif" alt=3D"SwishE2 Logo">
>     </h1>
>
>     <center>
>         <a href=3D"index.html">Table of Contents</a>
>     </center>
>
>     <p>
> EOF
> }
>
> sub footer {
>     return <<EOF;
>
>     <P ALIGN=3D"CENTER">
>     <IMG ALT=3D"" WIDTH=3D"470" HEIGHT=3D"10" =
> SRC=3D"../images/dotrule1.gif"></P>
>     <P ALIGN=3D"CENTER">
>
>     <div class=3D"footer">
>         <BR>SWISH-E is distributed with <B>no warranty</B> under the =
> terms of the
>         <A HREF=3D"http://www.fsf.org/copyleft/gpl.html">GNU Public =
> License</A>,<BR>
>         Free Software Foundation, Inc.,=20
>         59 Temple Place - Suite 330, Boston, MA  02111-1307, USA<BR>=20
>         Public questions may be posted to=20
>         the <A HREF=3D"http://swish-e.org/Discussion/">SWISH-E =
> Discussion</A>.
>     </div>
>
>   </body>
> </html>
> EOF
> }
>
################################

It prints out everything, except that it says: "Failed to find any =
files", but above that, it says: "Bad command or file name".

Any suggestions?

I can search from a console just fine.

 -David


 --------------------------------------------------
 Nancy's DSD Website
 http://www.deadseabeauty.net
Received on Tue Dec 10 02:40:51 2002