title: self submit form and cookie PHP
body: <p>I have a form that gets information from a database, after a user registers they are sent to a page where they make selection from radio buttons, after each selection I want to save the selection "10 in total" the first time the page show, the first selection shown and after that nothing. $count stay at 1 "not increment" can someone look at my code and tell me why.</p>
  
  <pre><code>&lt;?php       
  if(isset($_COOKIE['counter'])){
      $count = isset($_COOKIE['counter']);
      print($count);
  }
  else{
      $count = 1;
      print("Shouldn't see this after first click");
  }
  
  $connection = mysqli_connect("localhost", "root", "", "worldcup2014db");
  // Check connection
  if (mysqli_connect_errno()){
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  $querySelection = "SELECT * from teamselections where id = '$count'";
  
  $resultSelection = mysqli_query($connection , $querySelection);
  
          print("&lt;form method='post' action='selection.php'&gt;");
  
          while($row = mysqli_fetch_array($resultSelection)){
              $t1 = $row['team1id'];
              $t2 = $row['team2id'];
              $t3 = $row['team3id'];
              $t4 = $row['team4id'];
  
  
  
                  if($row['teamid'] == $t1){
                      $tName1 = $row['name'];
                  }
                  if($row['teamid'] == $t2){
                      $tName2 = $row['name'];
                  }
                  if($row['teamid'] == $t3){
                      $tName3 = $row['name'];
                  }
                  if($row['teamid'] == $t4){
                      $tName4 = $row['name'];
                  }                   
              }
  
              print("&lt;input type='radio' id='rd1' name='teamname' value='$t1'&gt;$tName1&lt;/input&gt;");
              print("&lt;input type='radio' id='rd2' name='teamname' value='$t2'&gt;$tName2&lt;/input&gt;");
              if($count &gt; 4){
                  print("&lt;input type='radio' id='rd3' name='teamname' value='$t3'&gt;$tName3&lt;/input&gt;");
                  print("&lt;input type='radio' id='rd4' name='teamname' value='$t4'&gt;$tName4&lt;/input&gt;");  
              }
  
              print("&lt;input type=\"submit\" name=\"submit\" value=\"Continue\"&gt;");                            
          }
          $count++; // increment count
          print("&lt;/form&gt;");
  
          setcookie('counter', $count);
          print($count);
  
          mysqli_close($connection);          
  </code></pre>
  
  <p>?></p>
  
  <p><img src="https://i.stack.imgur.com/4pSb1.png" alt="screenshot of when page loads first"></p>
  
  <p><img src="https://i.stack.imgur.com/bzz6v.png" alt="screenshot after continue is clicked, count set back to 1"></p>
  
  <p><img src="https://i.stack.imgur.com/up3MW.png" alt="screenshot of cookie setting in browser"></p>
  
  <p>thanks in advance</p>
  
  <p>Gman</p>