I’ve created an add and remove option for my cart. They work, however, I keep getting undefined index errors when it’s first loaded. Is there anything wrong, for example, with the remove option in the cart? This is the code:
$sessionelements = 'cart_' . $_GET['remove'];
$_SESSION[$sessionelements] = isset($_SESSION[$sessionelements]) ? $_SESSION[$sessionelements] - 1 : 1;
Check for the existence of the $_GET[‘remove’] variable before doing anything.