anevins Posted March 27, 2011 Share Posted March 27, 2011 Hello, I'm trying to implement a function called 'delete_cart' but I can't seem to get it working. Here's the function code: function delete_cart(){ unset($_SESSION['cart']); } Here's the HTML / php code: if (!empty($_SESSION['cart'])) { echo '<a href="index.php?p=cart?delete_cart=true">delete cart</a> '; } When you click on 'delete cart', the page just refreshes to the home page and I am able to re-visit that same cart with the same items in. I've also noticed when I log out, the shopping cart is deleted. Quote Link to comment Share on other sites More sharing options...
anevins Posted March 27, 2011 Author Share Posted March 27, 2011 bump Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.