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. Link to comment https://forums.phpfreaks.com/topic/231838-cart-problems/ Share on other sites More sharing options...
anevins Posted March 27, 2011 Author Share Posted March 27, 2011 bump Link to comment https://forums.phpfreaks.com/topic/231838-cart-problems/#findComment-1192878 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.