if statement doing one thing at a time

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?

Hi there,

I’ve fixed up your code and it should work:

[php]<?php

if($_POST[‘reset’])
{
unset($_SESSION[‘counter’]);
unset($_SESSION[‘display’]);
}

?>[/php]

I don’t know how your script worked in the first place, but this way should work for you. Hope this helps.

Sponsor our Newsletter | Privacy Policy | Terms of Service