Re: [htdig] Problem with integrating php and htdig

Subject: Re: [htdig] Problem with integrating php and htdig
From: David Robley (
Date: Mon Oct 16 2000 - 17:43:08 PDT

On Tue, 17 Oct 2000, Gilles Detillieux wrote:
> According to Nick Seacroft:
> > A search engine is installed and working. The search needs to be run
> > from php. php4 is installed and working on the server. A blank page is
> > displayed instead of search results. Below is the code in results.php. Is
> > there something missing? Do we need a $format entry? Is the exec line
> > correct?
> >
> > <?php
> > $HTSEARCH_PROG = "/home/httpd/INSuk/search/";
> > $words = EscapeShellCmd(UrlEncode($search));
> > $config = "insuk";
> > $query = "config=$config&format=$format&words=$words";
> > $command="$HTSEARCH_PROG \"$query\"";
> > exec($command,$result);
> > ?>
> I don't see any errors in the code above, but I'm no PHP expert. I do
> have to ask, though, are you sure the script referenced above
> does indeed call htsearch, passing it its argument as a quoted string?
> You may want to manually call this script with a query string argument
> constructed as above, to make sure it's working as it should. Also,
> if you haven't already done so, please read the "Search This" guide to
> using PHP with htsearch.
> See
> --
> Gilles R. Detillieux

Further to what Gilles has said: if the above is your script in total then
I would not expect it to display anything. The output from $command is
stored in the array $result; you would need to loop through the array and
display each of the elements.

Alternatively, consider using passthru which will pass back results

David Robley                        | WEBMASTER & Mail List Admin
AusEinet                            |
            Flinders University, ADELAIDE, SOUTH AUSTRALIA

------------------------------------ To unsubscribe from the htdig mailing list, send a message to You will receive a message to confirm this. List archives: <> FAQ: <>

This archive was generated by hypermail 2b28 : Mon Oct 16 2000 - 17:52:40 PDT