title: Unable to fill input value with PHP variable
body: <p>I have two files, landing.php and test.php. Landing.php has a form that is submitted via ajax using the post method to test.php. If the ajax call is successful, the browser loads test.php, at which point I am having an issue. I cannot figure out what I am doing wrong in my attempts to display the value of the post data that is sent to test.php.</p>
  
  <p>The following is the ajax call from landing.php. I am reasonably sure that this is working correctly from having looked at the post data in Firebug.</p>
  
  <pre><code>$('#searchForm').submit(function(e) {
      e.preventDefault();
      var data1 = $('#checkBoxDiv input').serialize() + '&amp;' + 'barcodeID=' + $('#barcodeID').val();
      $.ajax({
          url: 'test.php',
          data: data1,
          type: 'POST',
          success: function() {
              window.location.href = "test.php";
          }
      });  
  });  
  </code></pre>
  
  <p>Here are the contents of test.php.</p>
  
  <pre><code>&lt;?php
  
  $bar = $_POST['barcodeID'];
  
  echo "&lt;html&gt;";
  echo "&lt;body&gt;";
  echo "&lt;p&gt;*" . $bar . "*&lt;/p&gt;";
  echo "&lt;/body&gt;";
  echo "&lt;/html&gt;";
  ?&gt;
  </code></pre>
  
  <p>If I were to take the asteriks out of the line with the <code>&lt;p&gt;</code> from test.php, I would be presented with a completely blank screen when I arrived at test.php in my browser. With them there, however, I am presented with "**" on my screen. The most confusing part is, however, that if I include</p>
  
  <p><code>echo $bar;</code></p>
  
  <p>in test.php, I see the value of <code>$bar</code> (00-00102 - exactly as it should be) in Firebug's response tab on the post data viewer.</p>
  
  <p>After some research, I read that post was the method of choice for when you do not want to display query strings in the URL bar, as well as the method to use when you have a large amount of data to send (which will be the case for me, it'll end up being around five to six hundred characters when all is said and done). I've looked at other stackoverflow posts and articles, attempted to replicate what was recommended, and still cannot get this right.</p>
  
  <p>Am I doing something completely wrong or attempting to use these methods in a way in which they are not intended to be used? </p>