I've been trying to get PHP to work with htsearch and have had NO luck at
all.  I've gotten it compiled, installed and indexed, but when I run the
.php, IT DOES NOT WORK.

I followed the Search This! tutorial.  When I run the script and do a
var_dump on the $result, it prints out "int(126)"  <-- anyone know what the
heck this means?

Anyway, here's the code in my .php:

$HTSEARCH_PROG = "/home/sites/site21/local/htdig/htdig.sh";
$words = EscapeShellCmd(UrlEncode($search));
$config = "roguespear";
$format = "roguespear";
$query = "config=$config&format=$format&words=$search";

$command="$HTSEARCH_PROG \"$query\"";
passthru($command,$result);

$rc = count($result);

var_dump($result);

if($rc < 2)
{
        title("Search - Error");
        show_error("There was an error executing the search.  Please try again
later.<br><br>");
}
elseif($result[2] == "NOMATCH")
{
        title("Search - No Matches");
        show_error("There were no matches for <b>" . $search  . "</b> on the web
site.");
}
elseif($result[2] == "SYNTAXERROR")
{
        title("Search - Error");
        show_error("There is a syntax error in your search for
<b>$search</b>:<br><br>" . $result[3] . "</PRE>\n");
}
else
{
        Show matches
----
The error that always comes out is "There was an error executing the search.
Please try again later".

Anyone at all who can help me on this to get this working it would be
greatly apprecaited.  I really want this to work, but it's just killing me
that it won't and I don't know what's wrong.

Please help me out.  Thanks in advance.

- Mike Aeberhard
http://www.roguespeardatabase.com/


_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to