Sensei
- Join Date:
- Jan 2004
- Posts:
- 63,513
- Plugin Contributions:
- 176
Settings go blank...
Did you happen to try testing $_REQUEST instead of $_POST ?
Views: 12,263
Sensei
Did you happen to try testing $_REQUEST instead of $_POST ?
Sensei
DrByte:
Athenon:
So you are able to reproduce the error DrByte?
No -- I've tried all kinds of things and cannot reproduce it.
And from the research I've been doing, it doesn't seem to be a very common thing. It exists, but isn't plastered everywhere.
But, I bet if you go to your storefront and attempt to add a couple things to your cart from a product-listing you'll end up with some foreach() errors from the loop that processes $_POST ... :shocking:
New Zenner
DrByte:
Did you happen to try testing $_REQUEST instead of $_POST ?
No, but I shall try...one moment
Array ( [gID] => 1 [cID] => 4 [action] => save [__utma] => 190618288.598261983.1183229530.1188109571.1188113018.38 [__utmz] => 190618288.1183229530.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none) [cookieid] => e2d497219bcd789ce19f835ceb3c20ee [__utmc] => 190618288 [PHPSESSID] => e8i02ncc42p5i684e9t28eed40 [zenid] => ndc2tilenkh5bg0hi058gj15f4 [zenAdminID] => hk3a5kohno2ghjht9t73llp0v7 )
Frankly, I don't know what that means....but I'm hoping it's good :)
Sensei
Athenon:
Array ( [gID] => 1 [cID] => 4 [action] => save [__utma] => 190618288.598261983.1183229530.1188109571.1188113018.38 [__utmz] => 190618288.1183229530.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none) [cookieid] => e2d497219bcd789ce19f835ceb3c20ee [__utmc] => 190618288 [PHPSESSID] => e8i02ncc42p5i684e9t28eed40 [zenid] => ndc2tilenkh5bg0hi058gj15f4 [zenAdminID] => hk3a5kohno2ghjht9t73llp0v7 )
Frankly, I don't know what that means....but I'm hoping it's good :)
The gID , cID, action values are $_GET from the form on the configuration page.
The __utmX are google analytics stuff you've got installed
The PHPSESSID, zenid, zenAdminID are all cookie values.
New Zenner
the re-install didnt work either, so, i am going to bed since it is 2 am here. i will see if you may have a solution in the morning. thanks.
Sensei
methodcomptech:
the re-install didnt work either, so, i am going to bed since it is 2 am here.It's 5am here and I need to get some sleep too. I was just packing up when y'all posted !!
New Zenner
Nope, no foreach error...looks fine to me, although my cart is permanently empty no matter what I put in it due to bad sql queries, but we already knew that.
Sensei
Athenon:
Nope, no foreach error...looks fine to me, although my cart is permanently empty no matter what I put in it due to bad sql queries, but we already knew that.
Maybe we're doing better error-catching than I thought.
However, if $_POST is empty, I would naturally expect to see nothing going into the cart :(
Still not much further ahead ...
Sensei
What happens if you put this file on your server and run it ... call it formtest.php```
<?php echo '<pre>' . print_r($_POST, true) . '</pre>'; ?> <form name="configuration" action="formtest.php" method="post"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td>Please make any necessary changes</td> </tr> <tr> <td><br><b>First Name</b><br>Minimum length of first name<br> <input type="text" name="configuration_value" value="2" size="10"></td> </tr> <tr> <td align="center"><br><input type="submit"></td> </tr> </table> </form> ```And try running it from various places on your server ... different accounts, subfolders, etc.
It's just a simple extraction of part of the form built in the admin configuration.php file, attempting to mimic a basic form submit to $_POST.
New Zenner
I have come across somewhat of a revelation...some sql queries don't blank...for example, I just made an account and the info stuck.
Sensei
Is that on a URL I can access ?
New Zenner
DrByte:
Is that on a URL I can access ?
Sure thing. http://store.japanaradio.com/zencart
We're in the process of trying something, though, so it might be a bit shaky until we're done.
Sensei
I am seeing the error message I expected:> Warning: Variable passed to each() is not an array or object in /usr/home/jar/store/zencart/includes/classes/shopping_cart.php on line 1708... add a couple items to cart via a product listing, and it triggers it.
It doesn't happen on single-item clicks from the product-info page, since $_POST isn't treated as an array in that case. But since it's empty, the cart gets nothing added.
New Zenner
DrByte:
I am seeing the error message I expected:... add a couple items to cart via a product listing, and it triggers it.
Is it related to the mysql query problem?
Sensei
Athenon:
Is it related to the mysql query problem?
There's no mysql query problem as far as I can tell.
Is there another issue I've missed?
New Zenner
DrByte:
There's no mysql query problem as far as I can tell.
Is there another issue I've missed?
No I meant the fact that $_POST is typically blank...is it at all related to the foreach error?
Sensei
Athenon:
No I meant the fact that $_POST is typically blank...is it at all related to the foreach error?
Yes -- the foreach in the shopping cart is expecting $_POST to contain an array ... but since it's blank, an uncaught error is occurring.
New Zenner
DrByte:
Yes -- the foreach in the shopping cart is expecting $_POST to contain an array ... but since it's blank, an uncaught error is occurring.
So...what's going wrong and how do we fix it? (I know you probably don't yet know, but XD)
Sensei
Did you give a try for post #69 above ?
New Zenner
DrByte:
Did you give a try for post #69 above ?
Yeah. Works fine. That's the weird thing...it's only some POST forms, not all of them.
Tell staff why this post should be reviewed.