Greetings,
I am having problem with a shopping cart of mine. My cart works by clicking an add to cart image, which submits the form to: “/cart.php?operation=add”. This will also submit the rest form with “$_POST” using method.
On my cart.php page, I have something like this:
if ($_GET[‘operation’] == ‘add’) {
$cart = $_SESSION[‘cart’];
$quantity = $_POST[‘quantity’];
…add items to $cart array…
}
$_SESSION[‘cart’] = $cart;
header(‘Location: /cart.php’);
exit();
So my page is supposed to redirect from: cart.php?operation=add to cart.php. The problem is that my cart is ALWAYS adding 2 items instead of 1. This only happens in Internet Explorer too (versions 7, 8 and 9 that I tested). It’s like the redirect is keeping the ?operation=add parameter and does the same operation exactly twice.
This is one of the most bizarre glitches I’ve come across. I was wondering if anyone has come across this and what kind of solutions might be available.
Thanks