title: Cross-domain AJAX not working PHP
body: <p>I have tried to implement a cross-domain AJAX request, based on <a href="https://stackoverflow.com/questions/298745/how-do-i-send-a-cross-domain-post-request-via-javascript">this answer</a>.</p>
  
  <p><a href="http://jsfiddle.net/PXSMQ/1/" rel="nofollow noreferrer">http://jsfiddle.net/PXSMQ/1/</a></p>
  
  <p>I have added the following headers:</p>
  
  <pre><code>header('Access-Control-Allow-Origin:  *');
  header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
  header('Access-Control-Max-Age: 1000');
  header('Access-Control-Allow-Headers: Content-Type');
  header("Access-Control-Allow-Headers: x-requested-with");
  header('Access-Control-Allow-Headers: x-csrf-token');
  </code></pre>
  
  <p>But I still get this error:</p>
  
  <pre><code>XMLHttpRequest cannot load http://www.belardi.ro/userTrack/addData.php. Origin http://fiddle.jshell.net is not allowed by Access-Control-Allow-Origin. 
  </code></pre>