I've been trying to figure this out for hours, though I'm too uneducated in web development to understand. Heres the case:
Another website has a script that they obtain information from the following way:
var url = numbers.php;
parameters = scoreid= + document.getElementById('whatscore').value;
parameters += &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);
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.
When I attempt to directly request information from their page, the numbers.php page, such as example.com/numbers.php?scoreid=131&num=41 . I always get returned with Error: incorrect parameter syntax.
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.
I appreciate all help whatsoever!
NOTICE: I DO NOT HAVE ACCESS TO THE WEBSERVER.