title: Wrong data in session array
body: <p>There are some wrong numbers in my array</p>
  
  <pre><code>&lt;script&gt;
  var id=0;
  function getId(id2){
   id=id2;
   document.getElementById("idHid").value=id;
  document.getElementById("form").submit();
   }
  &lt;/script&gt;
  &lt;?php
  $n = 10;
  $st = 0;
  $_SESSION['cel']= 51;
  $razlika = 0;
  $idGet=0;
  $idArray=array();
  $vel = 0;
  echo "&lt;table&gt;";
  for($i=0;$i&lt;$n;$i++){
  echo "&lt;tr&gt;";
    for($x=0;$x&lt;$n;$x++){
      $st++;
      $id=(($x+1)+($i*$n));
  
      echo "&lt;td id=".$id." onClick='getId(".$id.")'&gt;&lt;b&gt;".$id."&lt;/b&gt;&lt;/td&gt;";
     }
   echo "&lt;/tr&gt;"; }
  echo "&lt;/table&gt;";
  if(isset($_POST['id'])){
  $idGet = $_POST['id'];
  $idArray=$_SESSION['ar']; 
  $idArray[$vel]=$idGet;
  $_SESSION['vel']+=1;
   $_SESSION['ar']=$idArray;
   }else{
   $_SESSION['vel']=0;
   $_SESSION['ar'];
  } 
  $vel=$_SESSION['vel'];
  for($i =0;$i&lt;$vel;$i++){
    echo $idArray[$i]."-".$vel."&lt;br&gt;";
                   }
  ?&gt;
  </code></pre>
  
  <p>If I click on some td's more than 7 times I start getting errors. I want to save all "id's" in session and I want to save number of clicks. </p>