Skip to main content.
home | support | download

Back to List Archive

Re: Cgi Script needing to display "No Results Found"

From: Ron Samuel Klatchko <rsk(at)>
Date: Tue Nov 02 1999 - 17:56:17 GMT
Eric Haymaker wrote:
> I am using both Swish-e and Swish.  The Swish came with a "toy cgi" that
> works well, except that it doesn't display "No Results Found" if the query
> words are not found.
> Has anybody managed to edit that cgi script so that it will tell users that
> nothing matched their query?  Or can someone give me an idea how to go about
> editing it do that?

Initialize a found variable to 0/false before the loop that reads the
data from the swish process (this is not absolutely necessary for perl,
but it's good style).  In the loop, if you get by all the the lines
you're ignoring, set the found variable to 1/true.  After the loop is
done, if the found variable is still 0, you haven't found any results.

           Ron Samuel Klatchko - Software Jester
            Brightmail Inc -
Received on Tue Nov 2 09:57:41 1999