edzillion
11-21-2008, 02:55 PM
My Code:
http=new XMLHttpRequest();
var url = "upload.php";
params = getParams();
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(params);
I am sending a lot of parameters - but that doesn't seem to cause the problem. The upload.php file runs fine if there is very little processing in it. If I just put in an echo, I get the response in an alertbox fine:
alert(http.responseText);
But the php file really needs to loop through the parameters and upload them to a mysql table. And if I uncomment this loop (even though there is only one iteration) then I get no response and the php file doesn't seem to execute at all.
Any ideas?
http=new XMLHttpRequest();
var url = "upload.php";
params = getParams();
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(params);
I am sending a lot of parameters - but that doesn't seem to cause the problem. The upload.php file runs fine if there is very little processing in it. If I just put in an echo, I get the response in an alertbox fine:
alert(http.responseText);
But the php file really needs to loop through the parameters and upload them to a mysql table. And if I uncomment this loop (even though there is only one iteration) then I get no response and the php file doesn't seem to execute at all.
Any ideas?