Hi - Take this with a grain of salt, because I am not sure I
really understand what this code is doing (or why some of it even
works;). However my guess is that the symptoms you describe are
due to the fact that you are not escaping the query. The ';' has
special meaning to the shell (the same would be true if you used
a '&' instead). As such, I think that ;page=$page will end up
being truncated from the query string and not seen by htsearch.
Jim
Kevin Breit's bits of 25 Jun 2002 translated to:
>Hey guys,
> I am using the following code to get ht://dig's results to integrate
>into the website interface:
>
>$HTSEARCH_PROG =
>"/home/kbreit/work/cvsdir/ximian/webroot_8_2001/cgi-bin/htdig.sh";
>$words = EscapeShellCmd(UrlEncode($words));
>
>$config = "/etc/htdig.conf";
>$words = urldecode($words);
>list ($words, $page) = split (";", $words, 2);
>list ($junk, $page) = split ("=", $page, 2);
>
>print("Words: $words<br>");
>echo ("Page: $page<br>");
>echo ("Junk: $junk");
>
>$query = "-c $config words=\"$words\";page=$page";
>
>$command="$HTSEARCH_PROG $query";
>
>exec($command,$result);
>
>print($page);
>
>$resultcount = count($result);
>
>for($i = 2 ; $i < $resultcount ; $i++)
>{
> echo $result[$i];
>}
>
>
>However, when I click to go to the next page, it doesn't actually
>incrememnt the page #. It lets it go to the next page, and the URL
>reflects this change. However, it still says 1-10 of 206.
>
>Could anyone offer suggestions?
>
>Thanks
>
>Kevin
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by: Jabber Inc.
>Don't miss the IM event of the season | Special offer for OSDN members!
>JabConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn
>_______________________________________________
>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
>
>
-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
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