title: Bypassing CORS with PHP and Javascript/Ajax
body: <p>I've been trying to figure this out for hours, though I'm too uneducated in web development to understand. Heres the case:</p>
  
  <p>Another website has a script that they obtain information from the following way:</p>
  
  <pre><code>    var url = "numbers.php";
  parameters = "scoreid=" + document.getElementById('whatscore').value;
  parameters += "&amp;num=" + document.getElementById('num1b1').value;
  
  xmlhttp2=GetXmlHttpObject();
  if (xmlhttp2==null) {
      alert ("Your browser does not support XMLHTTP!");
      return;
  }
  
  xmlhttp2.onreadystatechange = function() {
      if (xmlhttp2.readyState==4) {
          scorespot.innerHTML=xmlhttp2.responseText;              // load 
          setScores(document.getElementById('gradelvl').value);   // set 
          document.getElementById('submitscorebtn').style.display="none";
      }
  }
  xmlhttp2.open("POST",url,true);
  xmlhttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlhttp2.setRequestHeader("Content-length", parameters.length);
  xmlhttp2.setRequestHeader("Connection", "close");
  xmlhttp2.send(parameters);
  </code></pre>
  
  <p>I've attempted to do the same thing, though when I attempt it I get the cross-origin error. I know their are ways to do it with jsonp and other things, though I have no clue where to start at all for this.</p>
  
  <p>When I attempt to directly request information from their page, the numbers.php page, such as example.com/numbers.php?scoreid=131&amp;num=41 . I always get returned with "Error: incorrect parameter syntax".</p>
  
  <p>Can anybody please tell me how I would fix this in my case? I only know PHP and Javascript well, I'm very uneducated with Ajax and other things or external libraries.</p>
  
  <p>I appreciate all help whatsoever!
  NOTICE: I DO NOT HAVE ACCESS TO THE WEBSERVER.</p>