Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Using $_GET causes 404 - why?


functionexplode

Recommended Posts

Posted

I'm slowly going through my outdated code from my shop & trying to update bit-by-bit.

 

From the file: includes/functions/compatibility.php:

 

Original Code

// $HTTP_xxx_VARS are always set on php4
 if (!is_array($HTTP_GET_VARS)) $HTTP_GET_VARS = array();
 if (!is_array($HTTP_POST_VARS)) $HTTP_POST_VARS = array();
 if (!is_array($HTTP_COOKIE_VARS)) $HTTP_COOKIE_VARS = array();

// handle magic_quotes_gpc turned off.
 if (!get_magic_quotes_gpc()) {
   do_magic_quotes_gpc($HTTP_GET_VARS);
   do_magic_quotes_gpc($HTTP_POST_VARS);
   do_magic_quotes_gpc($HTTP_COOKIE_VARS);
 }

 

Switched with Updated code:

  if (PHP_VERSION >= 4.1) {
   $HTTP_GET_VARS =& $_GET;
   $HTTP_POST_VARS =& $_POST;
   $HTTP_COOKIE_VARS =& $_COOKIE;
   $HTTP_SESSION_VARS =& $_SESSION;
   $HTTP_POST_FILES =& $_FILES;
   $HTTP_SERVER_VARS =& $_SERVER;
 } else {
   if (!is_array($HTTP_GET_VARS)) $HTTP_GET_VARS = array();
   if (!is_array($HTTP_POST_VARS)) $HTTP_POST_VARS = array();
   if (!is_array($HTTP_COOKIE_VARS)) $HTTP_COOKIE_VARS = array();
 }

// handle magic_quotes_gpc turned off.
 if (!get_magic_quotes_gpc()) {
   do_magic_quotes_gpc($HTTP_GET_VARS);
   do_magic_quotes_gpc($HTTP_POST_VARS);
   do_magic_quotes_gpc($HTTP_COOKIE_VARS);
 }

 

Causes a 404 of my product pages. Any suggestions on what to troubleshoot?

Posted

Figured it out. My URL rewrite script is old as dirt, calling the product ID like so:

$HTTP_GET_VARS['products_id'] = $t['products_id'];

 

Changed to:

$_GET['products_id'] = $t['products_id'];

Archived

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

×
×
  • Create New...