I was just making a website with a cart system, and i was going to use the isset() function in conjunction with sessions. for example, i would start the session on the page that would be using sessions with session_start() above the html tag. then have a page called added.php, in which it would seta session variable called 1 with $_SESSION[1] = 1. then i would have an add cart button with an if statement saying if (isset($_SESSION[1]){echo'remove cart'} else {echo'add to cart'}. ive tried this and i click the add button, it goes to the add page, redirects, and it goes back to the main page, and it still says add cart!?! I cant figure out why!
sorry, meant if (isset($_SESSION[1]))
sorry, meant if (isset($_SESSION[1]))