Re: [htdig] passing $(WORDS)

Brett Baugh (
Tue, 02 Mar 1999 09:55:27 -0600

Eric Luhrs wrote:
> I use htdig to search a FAQ database, and on each FAQ there is a link to a
> form for user comments. The form gets emailed to me with the user's full
> name, username, email address, subject, and comments. There is also a
> hidden field which uses PHP to tell me which FAQ the user was reading when
> they clicked on the "comments" link. I would like to pass $(WORDS) to
> this form as well. That way I can use the feedback to evaluate my
> keywords, etc. Cany anyone think of a way for me to pass $(WORDS) from
> each document that is indexed, to the "comments" form? Thanks in advance.

It seems to me at first glance that this can't work, because the
search results from htdig, though it does have the $WORDS variable in
its form, won't have it on each and every link leading from the search
page to the links in question. Hmmmmmm. Well, you could always send
the $WORDS variable to the user's browser as a cookie while on the
search results page (somehow) and then read it back again in the
processor for the comments form (if said cookie exists; some people
refuse them), which would of course require that the search results
form is PHP-parsed as well... argh. How do you tell PHP to parse
something that's called "cgi-bin/htsearch"?? I don't think you can...
which means that htsearch *itself* would have to set that cookie. But
once that was accomplished, the rest would fall into place. Any
possibility of adding cookie-setting functionality to htsearch? The
only other solution I can think of is for htsearch to append
"?WORDS=the_words" (or "&WORDS=the_words" if it's already a cgi-type
link with a "?" in it) to each and every link it returns in a search
result... but that would be customized for just your FAQs and wouldn't
apply to anything else on your site or anyone else's site.

Ok; I think it's time for another htsearch configuration setting:
"add_cgi_words" or something, which will include, CGI-style, the WORDS
variable on all links that match a particular pattern; "/FAQs/*" or
something. If it includes "&WORDS=the_words" on a link that goes to a
page that doesn't have any programming in it, it'll just be ignored...
but if the called page already uses a variable called "WORDS" it could
get nasty, so there'd have to be some way to rename the variable
itself, too...

Man. Didn't think it was going to be this complicated. No matter
what solution you use for this problem, it's going to involve a LOT of
typing. But it could work if someone better at hacking C than I am
can do it, though it'd be pretty good experience... I just began my
foray into C hacking a couple of days ago by heavily modifying
mod_autoindex in Apache to get rid of those horrible hideous
fixed-width 23-character-truncated-filename "fancy" index listings it
generates and put it in a table instead. (If anyone wants a patch, I
have it for 1.2.6 and 1.3.4... :)

-Brett Baugh
System Administrator, Saper Media Group
To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the SUBJECT of the message.

This archive was generated by hypermail 2.0b3 on Thu Mar 04 1999 - 09:09:18 PST