G
gp
I have a an Ajax post sent to a php script on the server...the script
returns a response indicating that the _POST array wasn't set.
When I look at firebug, my headers appear to be ok, and the HTTP_POST
appears intact and doesn't appear out of sorts. And the response from
the PHP script is that of $_POST not being set.
function reqCocktailDetails(clid, cktlid) {
try {
var url = "http://<URL HERE>/process_xhr.php";
var str = "clid=" + clid + "&cktlid=" + cktlid;
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www=form-
urlencoded");
//http.setRequestHeader('Content-length', str.length);
//http.setRequestHeader('Connection', 'close');
http.onreadystatechange = hrGetDetails;
http.send(str);
} catch (err) {
var errorSpan = document.createNode("span");
$("divCktlPopUp_body").appendChild(errorSpan);
var errorTxt = err;
errorSpan.appendChild(errorTxt);
}
}
function hrGetDetails() {
if (http.readyState == 4) {
var responseTxt = http.responseText;
var respObj = eval("(" + responseTxt + ")");
var thisParentID = "divCktlPopUp_body";
if (!errorCheck(respObj, thisParentID)) {
buildCktlAddMod(respObj);
}
}
}
returns a response indicating that the _POST array wasn't set.
When I look at firebug, my headers appear to be ok, and the HTTP_POST
appears intact and doesn't appear out of sorts. And the response from
the PHP script is that of $_POST not being set.
function reqCocktailDetails(clid, cktlid) {
try {
var url = "http://<URL HERE>/process_xhr.php";
var str = "clid=" + clid + "&cktlid=" + cktlid;
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www=form-
urlencoded");
//http.setRequestHeader('Content-length', str.length);
//http.setRequestHeader('Connection', 'close');
http.onreadystatechange = hrGetDetails;
http.send(str);
} catch (err) {
var errorSpan = document.createNode("span");
$("divCktlPopUp_body").appendChild(errorSpan);
var errorTxt = err;
errorSpan.appendChild(errorTxt);
}
}
function hrGetDetails() {
if (http.readyState == 4) {
var responseTxt = http.responseText;
var respObj = eval("(" + responseTxt + ")");
var thisParentID = "divCktlPopUp_body";
if (!errorCheck(respObj, thisParentID)) {
buildCktlAddMod(respObj);
}
}
}