title: Why are $_POST variables getting escaped in PHP?
body: <p>When my PHP script receives data from an AJAX POST request, the <code>$_POST</code> variables are escaped. The really strange thing is that this only happens on my production server (running PHP 5.2.12 on Linux) and not on my local server (running PHP 5.3.1 on Windows).</p>
  
  <p>Here is the AJAX code:</p>
  
  <pre><code>var pageRequest = false;
  if(window.XMLHttpRequest)     pageRequest = new XMLHttpRequest();
  else if(window.ActiveXObject) pageRequest = new ActiveXObject("Microsoft.XMLHTTP");
  
  pageRequest.onreadystatechange = function() { }
  
  var q_str = 'data=' + " ' ";
  
  pageRequest.open('POST','unnamed_page.php',true);
  
  pageRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  pageRequest.setRequestHeader("Content-length", q_str.length);
  pageRequest.setRequestHeader("Connection", "close");
  
  pageRequest.send(q_str);
  </code></pre>
  
  <p>Is there any reason this is happening? And how should I fix this so that it works on both servers?</p>
  
  <p>Edit: I have the following settings for magic_quotes:</p>
  
  <pre><code>                     Local   Master
  
  magic_quotes_gpc     On      On
  magic_quotes_runtime Off     Off
  magic_quotes_sybase  Off     Off
  </code></pre>