Hello,

 I'm thinking that the problem that you are having with the
/cgi-bin directory is that you had not defined the
search_results_footer in conf.  Therefore Htdig was defaulting
to the cgi-bin directory in which Htsearch resides. So to remedy
this add the search_results_footer as I describe below.

This bring up another problem though.  As far as I can tell
the $(PAGELIST) variable defaults to the directory as defined
in the "search_results_footer" and does not assign a
"calling_page" as a variable appended to the URL Get method.
So you have two choices:

1) Change your results.php to index.html ( or whatever your
server's DirectoryIndex is set to). If you have php parsing all
html pages this will work fine. Otherwise create a .htaccess file
in your search directory and assign "DirectoryIndex results.php".

2) ( untested and ill advised) Or you could chop up the
$(PAGELIST) and insert your results.php in there.

------.

I'm assuming that you are using Colin Viebrock's example from
"http://www.devshed.com/Server_Side/PHP/Search_This" ?
If so try this.

1) Assign the search_results_footer ( along with your other
search results declarations ) in your conf file like so.

search_results_footer: /path/to/your/search/directory/results-footer.html
#Note: this is not your cgi-bin directory

2) Create a "results-footer.html" file and place it as stated in the path above.

3) Put the variables $(PAGEHEADER) and $(PAGELIST) in the
results-footer.html file... (No Html in this file)

3) In your results.php put the following lines in at the top of the page:

# If this IS first returned page, get $words from form and
# set $page to 1 so border appears around "page number image"
# else let Htdig $(PAGELIST) assign $page and $words.

if (!isset($page)):
 $words = EscapeShellCmd(UrlEncode($search));
 $page=1;
endif;

4)  change the loop that builds you "body" from:
while($i<$rc)

to->

# loop through all elements of array and break when
#2 are left ( PAGEHEADER and PAGELIST variables)
while($i<$rc-2)

5) Then put something like this at the bottom of your page:

 ### PRINT FOOTER
 # grab the match information for the results footer

  $page = $result[$i];
$pagelist = $result[$i+1];

  # output the match information

      echo "$page\n";
      echo "$pagelist<BR>\n";

1) Change your results.php to index.html ( or whatever your
server's DirectoryIndex is set to). If you have php parsing all
html pages this will work fine. Otherwise create a .htaccess file
in your search directory and assign "DirectoryIndex results.php".


Hope this helps,
Shawn


Joseph Cheek wrote:

> [that subject's hard to read, i know...]
>
> i have htdig 3.1.1 installed, and a wrapper [php] file that surrounds the
> search results, in order to give me dynamic content around the search results.
> it works *great*, except for one small thing: the page 1, 2, 3, etc. at the
> bottom of the search results link to /cgi-bin/htsearch instead of my
> /results.php wrapper.  is there any quick way to change this?  a perusal of
> the htdig.org web site and the config file docs didn't turn up anything that
> looks like it would work.
>
> thanks!
>
> joe
>
>       ___            ___
>    __ | |_   __   __ | |_      __   __   _____  * Joseph Cheek, Director
>   / _)|   \ / _) / _)|  _)    / _) /  \ |     | * [EMAIL PROTECTED] or
>  ( (_ | | |(  _)(  _)|  \  _ ( (_ ( () )| |_| | * (877) CHEEK.COM
>   \__)|_|_| \__) \__)|_\_)(_) \__) \__/ |_| |_| * http://www.cheek.com/
>     Cheek Consulting, Seattle, provides Linux and Internet solutions
>    linux * web commerce * html * java * perl * php * informix * mysql
>
> ------------------------------------
> To unsubscribe from the htdig mailing list, send a message to
> [EMAIL PROTECTED] containing the single word "unsubscribe" in
> the SUBJECT of the message.

------------------------------------
To unsubscribe from the htdig mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.

Reply via email to