title: How to get the data sent by ajax with php
body: <p><strong>Code in my <code>a.php</code> file:</strong></p>
  
  <pre><code>&lt;?php include ('b.php'); ?&gt;
  &lt;script type="text/javascript"&gt;
  function nf(info){
      $.ajax({            
          type:'POST',
          url:'a.php',
          data:'getinfo=' + info         
      }); 
  }
  }
  &lt;/script&gt;
  &lt;?php
  $info = $_POST['getinfo'];
  
  if($info=="1"){
      $_SESSION['ses1']=1;
  }else{
      $_SESSION['ses1']=2;
  }
  ?&gt;
  &lt;a onclick="nf(1)"&gt;Option1&lt;/a&gt; || &lt;a onclick="nf(2)"&gt;Option2&lt;/a&gt; 
  </code></pre>
  
  <p>When change <code>$_SESSION['ses1']</code> makes some changes in <code>b.php</code> file. But I can't retrieve the data?</p>