title: Cannot get proper return data
body: <p>What is wrong:  </p>
  
  <pre><code>$('#btnSend').click(function()
  {     
      var msg = $('#txtar').val();  // textarea
      alert (msg); // works well, for example 'abc'
      $.ajax(
      {
          type: "POST",
          url: "write.php",
          data: {msg: msg},
          success: function(r)
          {
              alert(r); // doesn't work
          }
      });
  });
  </code></pre>
  
  <p><code>write.php</code>:</p>
  
  <pre><code>$a = $_POST['msg'];
  echo $a;
  </code></pre>
  
  <p>Instead of <code>abc</code> I get the content of whole <code>write.php</code> file in the alert.</p>