Date: 01/17/09 (PHP Community) Keywords: browser Hi Guys! if (!session_start()) { session_start(); header("Cache-control: private"); $_SESSION['num'] = 0; $i = $_SESSION['num']; echo $i; } else { $i = $_SESSION['num']; echo $i; } if (!$i) $i = 0; (please ignore the echo's. They're what I've been using to track what the numbers are while I make this project) Right now, that's what I've got controlling my session for this particular thing. What happens is the value in $_SESSION['num'] increases every time the "add another item" link is clicked. A new set of fields pops up at the bottom of the form and it's filloutable. When you don't have any more things to add, you hit the submit button. But say I end up refreshing the page halfway through because I want to restart? Then the number doesn't reset back to 0. What's the best way to reset it back to zero on refresh or on the reloading of a page (without closing the browser) Thanks!
|