[Yams-discuss] Search feature
Brought to you by:
modred
From: Gaelyne G. <ga...@vi...> - 2000-03-15 13:33:25
|
G'day All, Special note to Pat - I have your answers in this mail as well. On Mar 15 2000 Garth Sainio <ga...@ap...> wrote: > The second problem may be related to the fact that I use the environment > variable HTTP_REFERER in the creation of the session_id, so if you go to > the page directly then that value is not available - that explains the > use of initialized variable at Cart.pm line 1894 error. But that really > shouldn't be causing the the malformed header error (which I couldn't > recreate on my box at home, so it may have something to do with the way > apache is configured). > > To fix the use of the unitialized value, change line 1893 from > > my($http_ref) = $ENV{'HTTP_REFERER'}; > > to > > my($http_ref) = $ENV{'HTTP_REFERER'} || ""; I made this change, and it changed the error log info (included below), but it still resulted in Apache reporting an error in completing the directive on the web page. > Are you using any other includes in the page with the include for the > search form? > Do they work? Yes, I'm using an include for header and footer on the index page. These work fine. I tried adding in the toplevel.pl?type=department include, but this resulted in another "error processing this directive" from Apache. To further test, I have a cgi-bin perl script that displays random text and is an include. I tried it on the shop page as both: <!--#include virtual="blah" --> and <!--#exec cgi="blah"--> and it worked OK both times. Feeling experimental, I changed the Yams include statements to <!--#exec cgi=".."--> and had the "error processing this directive" error from Apache. It was worth a try. > Is it running as a cgi script or as an Apache::Registry script? cgi script. > Are you using the latest version of cart.pl? Yes. Pat asked me to try cart.pl from the command line and report the results. Here it is - this is the result **AFTER** changing line 1893: ---------------------------- [shop] # cart.pl (offline mode: enter name=value pairs on standard input) action=print_search <FORM METHOD="POST" ACTION="/cgi-bin/commerce4/shop/cart.pl" ENCTYPE="application/x-www-form-urlencoded"> <INPUT TYPE="text" NAME="search_terms" SIZE=15 MAXLENGTH=50><SELECT NAME="where"> <OPTION VALUE="Name">Name <OPTION VALUE="Description">Description </SELECT> <INPUT TYPE="submit" NAME=".submit"><INPUT TYPE="hidden" NAME="action" VALUE="search"><INPUT TYPE="hidden" NAME="session_id" VALUE="8O69g43o0cuU0lWfxnnNRgJp"></FORM>Wed Mar 15 23:12:10 [shop] # ---------------------------- Here's the log file result **AFTER** changing line 1893, and I've included the toplevel.pl one for measure. This isn't an option that I normally use though. [error] malformed header from script. Bad header=<FORM METHOD="POST" ACTION="/c: /cgi-bin/commerce4/shop/cart.pl [error] unable to include "/cgi-bin/commerce4/shop/cart.pl?action=print_search" in parsed file /commerce/shop/index.html toplevel.pl: Use of uninitialized value at (eval 14) line 27. [error] malformed header from script. Bad header=<H2>Choose Department</H2><FOR: /cgi-bin/commerce4/shop/toplevel.pl [error] unable to include "/cgi-bin/commerce4/shop/toplevel.pl?type=department" in parsed file /commerce/shop/index.html > As a short term solution, the following HTML code should create the > desired form (with the updated path to the cart.pl script): > > <FORM METHOD="POST" ACTION="/registry/commerce/shop/cart.pl" > ENCTYPE="application/x-www-form-urlencoded"> > <INPUT TYPE="text" NAME="search_terms" SIZE=15 MAXLENGTH=50> > <SELECT NAME="where"> > <OPTION VALUE="Name">Name > <OPTION VALUE="Description">Description > </SELECT> > <INPUT TYPE="hidden" NAME="action" VALUE="search"> > <INPUT TYPE="submit"> > </FORM> Thanks, Garth. This DOES work for the item name. Which description is it using? I tried a couple of tests for the description using words that are in the shop item descriptions but each time it didn't come up with a match when it should have. Cheers, Gaelyne |