Log in

View Full Version : if statement doing one thing at a time



deadman6
09-15-2011, 12:45 AM
When i do this



<?php if($_POST[reset]) {
unset($_SESSION[counter]);
unset($_SESSION[display]); } ?>

with a submit button with the name reset...

when i do it this way it resets the counter on the first click then display on the second... is there a way to do it with one click?

fastsol1
09-15-2011, 02:52 AM
I can't see why it would not unset both on the first click, bu there is a better way to do it.


<?php if(isset($_POST[reset])) {
unset($_SESSION['counter'], $_SESSION['display']); } ?>