Well, if you want to send a request to a PHP file using GET- or POST-statements and receive the returned data, you can use the XMLHTTP ActiveX object. An example code would be:
code:
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
//Replace"POST" by "GET" if you want to use GET-statements
//Enter your URL in the 2nd parameter
xmlhttp.open("POST", "http://www.mysite.com/myscriptpage.php", true);
//Remove the following line if you want to use GET instead of POST.
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
//Enter the statements which have to be sent, separated by a &-sign.
//Ex: a=5&b=myscript
xmlhttp.send("a=5&b=myscript");
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState==4) {
if(xmlhttp.status == 200){
//It worked, we have a response!
Debug("Yay! Success! Here's the returned HTML:");
Debug.Trace(html.responseText);
}else{
//Hmm... something went wrong here...
Debug.Trace("Mayday, Mayday, we have an XMLHTTP error!");
}
}
}