Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Serious issues with PHP v4.3.0


dreamscape

Recommended Posts

ok on application_top.php I have included this:

$HTTP_SERVER_VARS =& $_SERVER;

$HTTP_ENV_VARS =& $_ENV;

$HTTP_COOKIE_VARS =& $_COOKIE;

$HTTP_GET_VARS =& $_GET;

$HTTP_POST_VARS =& $_POST;

$HTTP_POST_FILES =& $_FILES;

$HTTP_SESSION_VARS =& $_SESSION;

 

and register_global ON on my php .

I'm still getting error

 

Query was empty - Query was empty

 

Query was empty

 

[TEP STOP]

anyone can help me??

Take a look at my site http://bdbazar.com

sometime it works sometime not. I disable gift vouchar and other modules.

Link to comment
Share on other sites

  • Replies 65
  • Created
  • Last Reply

hosting company upgraded to phpv4.3, and now clients cannot checkout on my cart...

 

usings OSC v2.1, no extensions installed

 

I've tried these suggested fixes:

 

$HTTP_SERVER_VARS &= $_SERVER;

$HTTP_ENV_VARS &= $_ENV;

$HTTP_COOKIE_VARS &= $_COOKIE;

$HTTP_GET_VARS &= $_GET;

$HTTP_POST_VARS &= $_POST;

$HTTP_POST_FILES &= $_FILES;

$HTTP_SESSION_VARS &= $_SESSION;

 

and...

 

$HTTP_SERVER_VARS = $_SERVER;

$HTTP_ENV_VARS = $_ENV;

$HTTP_COOKIE_VARS = $_COOKIE;

$HTTP_GET_VARS = $_GET;

$HTTP_POST_VARS = $_POST;

$HTTP_POST_FILES = $_FILES;

$HTTP_SESSION_VARS = $_SESSION;

 

but neither has any effect on the functionality of the cart

 

 

any ideas ? does upgrading to v2.2 solve this?

 

what in the checkout system of v2.1 would cause this to fail in phpv4.3?

 

please help... i'm good w/ php, but don't know all of the ins & outs of OSC... guess I'm gonna have to learn pretty fast, tho, huh? ! :)

Link to comment
Share on other sites

Help Needed!!!

I have October 2.2CVS - And upgrade to PHP4.3.1 on localhost - and now whenever i access the catalog side, it just diverts to login page (white screen) and keeps refresshing!!

 

What the hell is wrong, had to happen 1 day before I was going to go live...

 

PS I have tried ALL of the Globals!!

Link to comment
Share on other sites

Help Needed!!!

I have October 2.2CVS - And upgrade to PHP4.3.1 on localhost - and now whenever i access the catalog side, it just diverts to login page (white screen) and keeps refresshing!!

 

What the hell is wrong, had to happen 1 day before I was going to go live...

 

PS I have tried ALL of the Globals!!

 

Never mind - I have fixed the problem, I just needed to restart my system, not just apache.

 

It works great!! (I hope) - Not fully tested it!!

Link to comment
Share on other sites

Help Needed!!!

I have October 2.2CVS - And upgrade to PHP4.3.1 on localhost - and now whenever i access the catalog side, it just diverts to login page (white screen) and keeps refresshing!!

 

What the hell is wrong, had to happen 1 day before I was going to go live...

 

PS I have tried ALL of the Globals!!

 

Never mind - I have fixed the problem, I just needed to restart my system, not just apache.

 

It works great!! (I hope) - Not fully tested it!!

 

YEP - Fully works, not a problem in sight, didn't even have to do the mass superglobal changes..

Link to comment
Share on other sites

I've come up with the solution for my site...

 

Lets do a quick poll.

All those who are running 'Ad Tracker' say, DOH!

 

Yup!

The Ad Tracker modification in application_top.php is where the problem was for me.

 

Just remove the following... none of this $HTTP changing stuff, and you're back in action.

 

/* Ad Tracker - Start

 if (!$advertiser) {

     $advertiser = $_GET["ad"];       

     tep_session_register('advertiser'); 

  }

  

  if (!$referer_url) {

   $referer_url = $_SERVER['HTTP_REFERER'];

   tep_session_register('referer_url');

 }

/* Ad Tracker - End */

 

Let me know if you have any luck with this one.

 

Tony

"The price of success is perseverance. The price of failure comes much cheaper."

Link to comment
Share on other sites

when I try to register @ my webshop.

The registration is ok, because the data is correct in the database. But the visitors cancel their shopping 'cause they get the TEP STOP error.

 

I've changed the $HTTP_SERVER_VARS -> $_SERVER etc. but still getting the same error...

 

Could someone please help me with this

 

This is my create account url: http://www.funtronics.nl/kaicomputers/crea...ate_account.php

Link to comment
Share on other sites

i had same problem when my isp switched to PHP4.3

Query was empty - Query was empty  

 

Query was empty  

 

[TEP STOP]

Problem was user tracking contribution so i guess all of us have problems with contributions.

I have three different date oscommerce shops and all work but this one with this contribution. All i've done was comment out this:

 

 if (!$referer_url) {

   $referer_url = $HTTP_SERVER_VARS['HTTP_REFERER'];

   tep_session_register('referer_url');

 }

Maybe some programmer will know what's real problem.

Have a nice day

Tom

Link to comment
Share on other sites

i had same problem when my isp switched to PHP4.3
Query was empty - Query was empty  

 

Query was empty  

 

[TEP STOP]

Problem was user tracking contribution so i guess all of us have problems with contributions.

I have three different date oscommerce shops and all work but this one with this contribution. All i've done was comment out this:

 

 if (!$referer_url) {

   $referer_url = $HTTP_SERVER_VARS['HTTP_REFERER'];

   tep_session_register('referer_url');

 }

Maybe some programmer will know what's real problem.

Have a nice day

Tom

 

can you tell me which contribution, and which file that it in, I know I seen it but Dont feel like going through every file to find it lol

 

thanks

 

 

Ohh, and I have tried everything listed here, and still have the same problem,

 

I will have to upload the core MS1 to this server (I am using Loaded% from Ian) to see if the stock OSC works on PHP4.3

 

This server DOES have globals on... and still has thos error

Michael

Link to comment
Share on other sites

I am using php 4.2.3

OSC MS1

Globals on.

In .htaccess I added this.

<IfModule mod_php4.c>

php_flag register_globals On

php_flag track_vars On

</IfModule>

I did find and replace of variables as suggested.

 

I still get this error when i add to cart>

shoppingcart Object ( [contents] => Array ( ) [total] => 0 [weight] => 0 [cartID] => [content_type] => )

 

Your Shopping Cart is empty!

 

 

To further confuse the problem....

 

To trace what was happening with the script below, I put the echo "a"; line in the code. This of course resulted in header errors. I then removed the echo "a"; line, and the HTTP_ var was set. I HAD A FRIKING ITEM IN MY FRIKING SHOPPING CART. I tried resubmitting a second time (with the echo "a"; line gone) and it didn?t register until pasted line in, posted again (got header error), removed echo "a"; line and refreshed.

 

Here is the code that is causing the problem. Register globals is on.

 

line 335 application_top.php

 

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

echo "a";

}

 

install is here.

http://www.paintballgear.memelabs.com/osc/catalog/

 

Thanks anyone who takes a look.

Link to comment
Share on other sites

  • 2 weeks later...
All you need to do is to set register_globals to on in your php.ini.

 

If you don't have access to php.ini, then you can set it in your .htaccess file:

php_flag register_globals on

 

The reason the PHP developers made this change is for security reasons. It's too easy to write flawed code with register_globals on. Granted, osCommerce as a package has some pretty solid code already, but if you modify it as an amateur, and don't check every form field input, for example, well, things could get hairy. Especially when you're processing credit cards.

 

The point is. If you can at all avoid it, don't enable register_globals, make the necessary adjustments in the code instead. This should be addressed by the entire oscommerce package soon enough anyway.

Link to comment
Share on other sites

I commented the line in my app top

if (!$referer_url) { 

$referer_url = $HTTP_SERVER_VARS['HTTP_REFERER']; 

tep_session_register('referer_url'); 

}

 

as the a prev. post said..... and all os working so far.

 

I hope that it is fixed soon though.. I liked this contrib.!!!!!!!!!!!

 

 

webdeva

Link to comment
Share on other sites

  • 2 weeks later...

I had probelms with php4.3.0

I added to 'application_top.php' :

$HTTP_SERVER_VARS =& $_SERVER;

$HTTP_ENV_VARS =& $_ENV;

$HTTP_COOKIE_VARS =& $_COOKIE;

$HTTP_GET_VARS =& $_GET;

$HTTP_POST_VARS =& $_POST;

$HTTP_POST_FILES =& $_FILES;

$HTTP_SESSION_VARS =& $_SESSION;

 

now when I add items to cart the cart I get: "Your Shopping Cart is empty!"

 

Help...

Link to comment
Share on other sites

  • 3 months later...

HELP :!:

 

I am running PHP 4.3.2 and the cart empties out as soon as I try to checkout. Same code, same database but on a server running PHP 4.2.2 and it works perfectly.

 

I have tried doing this in application_top.php like suggested:

 

$HTTP_SERVER_VARS =& $_SERVER;

$HTTP_ENV_VARS =& $_ENV;

$HTTP_COOKIE_VARS =& $_COOKIE;

$HTTP_GET_VARS =& $_GET;

$HTTP_POST_VARS =& $_POST;

$HTTP_POST_FILES =& $_FILES;

$HTTP_SESSION_VARS =& $_SESSION;

 

but to no avail.

 

My register_globals is ON.

 

Any Suggestions :?: :?: :?:

Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.

Link to comment
Share on other sites

In .../catalog/includes/functions/sessions.php, I changed this:

 

function tep_session_close() {

if (function_exists('session_close')) {

return session_close();

}

}

 

to this:

 

function tep_session_close() {

if (function_exists('session_write_close')) {

return session_write_close();

}

if (function_exists('session_write')) {

session_write();

}

if (function_exists('session_close')) {

return session_close();

}

}

 

That seems to have helped. It looks like the PHP session API has changed somewhat. The existing code avoids crashing with "undefined function" when it's missing, but it doesn't try any alternatives, so the session never gets saved.

Link to comment
Share on other sites

In .../catalog/includes/functions/sessions.php, I changed this:

 

 function tep_session_close() {

   if (function_exists('session_close')) {

     return session_close();

   }

 }

 

to this:

 

 function tep_session_close() {

   if (function_exists('session_write_close')) {

     return session_write_close();

   }

   if (function_exists('session_write')) {

     session_write();

   }

   if (function_exists('session_close')) {

     return session_close();

   }

 }

 

That seems to have helped.  It looks like the PHP session API has changed somewhat.  The existing code avoids crashing with "undefined function" when it's missing, but it doesn't try any alternatives, so the session never gets saved.

 

No luck. Still the cart empties out as soon as the Checkout button is clicked. Thanks anyways.

Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.

Link to comment
Share on other sites

I am very surprised. So many people have posted their problems here and no one comes back with a solution ???

 

Shahid of bdbazar.com - you had a problem - i now see your cart working alright - how did you solve your problem.

 

I think whoever got it sorted, must also come back and report how they got it sorted!!!!!!!

 

Well I dont have this problem, but still I felt that people should come back and report how they solved their problem.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...