title: ajax returns variable from next page, but it's not actually there on arrival
body: <p>I am posting a variable via ajax from index.php to home.php. If there is success, I echo back the variable (userID). Otherwise, I echo "Noone". On index.php, I receive an alert with "user:1" + a bunch of other garbage from the page. Neverminding the garbage, which is the rest of the page's contents for some reason (a previous question I asked didn't seem to answer this), it seems the post worked. However, when I actually load the home.php, "Noone" is printed out at the top of the page, which of course destroys all of my queries. Any suggestions? Thanks for checking this out.</p>
  
  <p>index.php:</p>
  
  <pre><code>$.ajax({
  url: "home.php",
  type: "POST",
  data: {uName:uid},
  datatype: "text"
  }).success(function(data){
      alert("user:" + data);
      window.location.replace("home.php");
  });
  </code></pre>
  
  <p>home.php:</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['uName'])){
      $curUser = $_POST['uName']; 
  }
  else
      $curUser = 'Noone';
  echo $curUser;
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;...
  </code></pre>