title: Post jQuery variable on same file and receive with PHP
body: <p>How can I post jQuery data and receive on the same file without passing through the URL as a variable (eg. <code>test.php?data=xxx</code>).</p>
  
  <p>For example here's the response.data that I can see in the console log. </p>
  
  <pre><code>function (response) {                       
      console.log(response.data);
  },
  </code></pre>
  
  <p>I want to post that data and receive on the same file. I have tried following:</p>
  
  <pre><code>function (response) {                       
      //console.log(response.data);
      $.post(window.location.href, {json_data: response.data});
  },
  </code></pre>
  
  <p>but when in the body of same file I print </p>
  
  <pre><code>print_r($_POST);
  </code></pre>
  
  <p>it does not display anything.</p>