Skip to content Skip to sidebar Skip to footer

Unset Session Variable On Button Click Event

I can't unset a session variable properly using a 'remove button' click. I have two pages: product page and shopping cart page, but problem is that I have a 'remove button' in the

Solution 1:

It might be caused by

  1. $pid=$_SESSION['pid1']; instead of $pid=$_POST['pid1'];

  2. event that is tied to tag wrapped around a button, you coud just use

<input type="button" class="button2" value="Remove" onclick="del('<?php echo $pid?>');"/>

Post a Comment for "Unset Session Variable On Button Click Event"