Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product_reviews resulting in 302


soccermeister

Recommended Posts

Posted

update: I think I found out where the redirect is occurring but I'm not a coder so I don't know why it's happening. I found this in product_reviews.php:

 

$product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

if (!tep_db_num_rows($product_info_query)) {

tep_redirect(tep_href_link(FILENAME_REVIEWS));

 

 

I was checking my Google Webmaster account and noticed that Google was complaining about a 302 redirect in my Sitemap.xml file. I checked into it and it turns out that product_reviews.php and product_reviews_info.php are sending back a 302 redirect to reviews.php. I can't figure why this is happening or where to fix it. Can anyone point me in the right direction?

 

http://www.fragranceandhandbagboutique.com/product_reviews.php

 

GET /product_reviews.php HTTP/1.1

Host: www.fragranceandhandbagboutique.com

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Referer: http://www.fragranceandhandbagboutique.com/sitemappages.xml

Cookie: cookie_test=please_accept_for_session; osCsid=82d8686ec78fe4acaaf6250c3ee1ae28

Authorization: Basic Y2xhdXM6KlNhbTIwMDUq

 

HTTP/1.x 302 Moved Temporarily

Date: Mon, 04 Jan 2010 04:39:21 GMT

Server: Apache

X-Powered-By: PHP/5.2.11

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Pragma: no-cache

Content-Encoding: gzip

Vary: Accept-Encoding

Set-Cookie: cookie_test=please_accept_for_session; expires=Wed, 03-Feb-2010 04:39:21 GMT; path=/; domain=www.fragranceandhandbagboutique.com

Location: http://www.fragranceandhandbagboutique.com/reviews.php

Keep-Alive: timeout=5, max=100

Connection: Keep-Alive

Transfer-Encoding: chunked

Content-Type: text/html

Posted

Well, according to the code you listed, your product query ("product_id" passed in a URL query string) is returning no results (0 rows). You are then redirected (302 temporary redirect) to the reviews page. Your mission is to figure out why you are getting no hits on the search. You can go into phpMyAdmin and run the same SQL query for a product you know exists (product_id) and a language you have implemented. My guess would be that either a bogus product_id is being passed in (should be numeric 1, 2, 3,...) or the language_id variable is bad for some reason (say, 0). You may have to put an echo '<p>' . (int)$HTTP_GET_VARS['products_id'] . ' ' . (int)$languages_id . '</p>'; before the query statement, to see if you're starting out with good values, or 0's. If either is 0, try removing (int) to see what the raw value is.

 

I see you're running with a pretty recent PHP (5.2.11). What version of osC are you using? That level of PHP may no longer provide "long variable arrays" such as $HTTP_GET_VARS -- you need a recent osC version (2.2 RC1 or possibly RC2) that supplies that array if it's missing. If you're on an older osC, you will have problems. If this is what's happening, see if there is a PHP configuration switch to turn these long arrays back on -- that could buy you some time to upgrade.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...