Results 1 to 2 of 2

Thread: if statement doing one thing at a time

  1. #1
    Join Date
    Sep 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default if statement doing one thing at a time

    When i do this
    Code:
    <?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?

  2. #2
    Join Date
    Jul 2010
    Location
    Minnesota
    Posts
    256
    Thanks
    1
    Thanked 21 Times in 21 Posts

    Default

    I can't see why it would not unset both on the first click, bu there is a better way to do it.
    PHP Code:
    <?php if(isset($_POST[reset])) {
    unset(
    $_SESSION['counter'], $_SESSION['display']); } ?>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •