register_globals = Off
| From: | Holzner Roland | Date: | Fri, 06 Sep 2002 08:19:33 +0000 |
| Subject: | register_globals = Off | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-115409@lists.php.net to get a copy of this message | ||
Hi there
In my shop a had this code to add a product to the shoppingcart:
session_start();
session_register("cart");
if($action == "addtocart")
{
$cart[] = "$id,$amount";
}
To view the cart i had to explode the session_variable $cart and get
more data from the database.
session_start();
foreach($cart as $value)
{
$value = list($id, $amount) = explode(",", $value);
echo "$id : $amount\n";
}
This workt perfect bevor i hat to reinstall my Computer.
Now i have php 4.2.2 and every time i want to add a product to the cart
it overwrites my session_variable.
So now i have only the newest variable in the session_variable.
I've tried it with $_REQUEST, $_SESSION, import_request_variables() but
none of them gives me my array back.
Can you help me ?