Re: [htdig] passing SSI variable to htsearch

Gilles Detillieux (
Wed, 12 May 1999 08:57:52 -0500 (CDT)

According to Greg:
> I have now modified the contrib htwrap script by John Grohol to include the
> random banner generation with image, alt and url info. I then modified the
> $ENV{'QUERY_STRING'} to include the variable $bannerad as follows:
> "config=$config&restrict=$restrict&exclude=$exclude&word=$squery&method
> =$method&format=$format&page=$page&bannerad=$bannerad";
> This prints to the screen ok just before the script calls htsearch. I also
> included a $bannerad reference in header.html and modified the necessary
> html call to the new cgi with GET instead of POST. The search works great,
> but the problem I have now is htsearch still doesn't seem to recognize the
> variable for output in header.html. What am I missing or how do I pass the
> variable to htsearch?

You seem to be confusing environment variables with CGI input parameters.
They're two different beasts altogether, although all the CGI input
parameters will be lumped into the one environment variable, QUERY_STRING,
when using the GET method.

What you want to do in your Perl script is set a different environment
variable to the text of the ad, before you call htsearch. E.g.:

        $ENV{"BANNERAD"} = $bannerad;

then refer to that environment variable in header.html as $(BANNERAD).
You should not make any modifications to the query string.

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930
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 Wed May 12 1999 - 07:12:33 PDT