X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Search not working anymore... (https://forum.x-cart.com/showthread.php?t=2125)

guytje 04-02-2003 08:09 AM

Search not working anymore...
 
Hi,

Something strange happened...

We haven't changed anything in the back end of our shop, but since a few days the search funtion isn't working anymore... or at least, it's not returning any results!!! And it worked like a charm before.

This is the site I'm talking about: http://www.posters-affiches.com

I don't know if anyone has had the same problem, but I hope someone has a solution.

Thanks in advance,
Guytje

machnhed1 04-02-2003 08:33 AM

I looked at the site an noticed two things...

(1) You have an error on the page. Check it out in IE and you will see the error in the lower lefthand corner.

(2) Try changing your action back to:
Code:

action="../customer/search.php"

If all esle fails try reuploading your search.php file. It may have been corrupted.

guytje 04-02-2003 08:58 AM

hmmmm... Something with substring...
 
This is really weird:

When I do a search, the result automatically generates a

?PHPSESSID=c1aacfb728c5a2d87fd7428bc66fa12b&substr ing=

and then the substring... This should not be. It should be something like:

http://www.posters-affiches.com/shop/customer/search.php?substring=

Which works like a charm!

Any idea???

Thanks,
Guy

machnhed1 04-02-2003 09:03 AM

Na, that session ID is normal. It works fine on my site. I am betting your search.php file is corrupted.

Just a guess.

guytje 04-02-2003 11:39 PM

Can't be...
 
Well, I don't think that's true, because:

http://www.posters-affiches.com/shop/customer/search.php?substring=

works fine

But

http://www.posters-affiches.com/shop/customer/search.php?PHPSESSID=c1aacfb728c5a2d87fd7428bc66fa 12b&substring=

Doesn't yield any results!

Any idea?
Me

machnhed1 04-03-2003 07:35 AM

Since you haven't changed anything on the backend, I still think your search.php file is corrupted, but that's just a guess. :roll:

I would contact x-cart, if you are still under their support, they can fix it for you.

guytje 04-03-2003 08:40 AM

thanks!
 
I did it, and they had the matter fixed within a few hours! Am still at a loss about what the problem was...

But thanks for your concern.
Cheers,
Guy

machnhed1 04-03-2003 08:50 AM

Guy,

Excellent news. Looks like that session ID stayed in the URL after all.

If you are curious about the problem, email them back and ask for an explanation. It can be a tremendous help for any future occurences, besides I am very interested in their answer. :D

guytje 04-03-2003 11:12 AM

Will do!
 
Keep you posted!

;-)

G.

guytje 04-05-2003 06:24 AM

fixed...
 
Well, this is what they did:

$ have replaces the following lines in customer/search.php:

================================
$tmp=strstr($QUERY_STRING, "XCARTSESSID=");
if (!empty($tmp))
$QUERY_STRING=ereg_replace("XCARTSESSID=([0-9a-zA-Z]*)", "", $QUERY_STRING);

if(!empty($QUERY_STRING)) {
================================

with the following one line:

if(isset($substring)) {

Am don't know what/how... but it works like a charm ;-)

Thanks still for the help.
Cheers,
Guy[/b]

machnhed1 04-05-2003 08:13 AM

Here's a break down of what they did...
================================
$tmp=strstr($QUERY_STRING, "XCARTSESSID=");
// Find the xcart session ID in the search string

if (!empty($tmp))
// If the session ID is found do the following

$QUERY_STRING=ereg_replace("XCARTSESSID=([0-9a-zA-Z]*)", "", $QUERY_STRING);
// Strip out the xcart session ID and its value then replace it with nothing, then set $QUERY_STRING equal to the resulting value

if(!empty($QUERY_STRING)) {
// if the resulting value is not empty then do the following
================================

They then just bipassed all that with:
================================
if(isset($substring)) {
// if you have a substring (the value submitted by the form) then run the following code
================================

Weird thing is, that the code they stripped out is in my search.php file and it works well. :?:

Hope that's clear! :D

machnhed1 04-25-2003 07:53 AM

guytje,

It's been while since a post was made here, but I thought I would let you know that I turned off the session ID's on my site and ended up using your code mod from the x-cart team to fix my search as well.

What comes around goes around, I guess. :)

guytje 04-25-2003 08:02 AM

Cheers
 
:wink:


All times are GMT -8. The time now is 09:09 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.