I am trying to send some data from a HTML form via Ajax but using POST because it's going to be private data and I don't want to use GET.

This is the code but I can't get it to echo out the data on the CheckPass.php side.

function CheckPass1(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url = "/ajax/CheckPass.php";
var parameters = "pass="+str;
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", parameters .length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {//Handler function for call back on state change.
if(http.readyState == 4) {
document.getElementById("CheckPass1").innerHTML=xm lhttp.responseText;
}
}
http.send(parameters);
}

Any help would be great!