PHP and redirect problems exclusive to Internet Explorer

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

Nevermind!

Turns out that when I submitted the form with the submit button, there was javascript validation plus “document.form.submit();”, so this must have submitted the form twice. Thank God it wasn’t some extremely advanced PHP / IE backend stuff that I have no knowledge of or a complete shopping cart redesign!. Though it was annoying because this issue was only made apparent on internet explorer but not FF or Chrome.

Hopefully this also explains the issue some people had with their shopping cart suddenly crashing on IE7 with script errors…

Thanks for looking.