provato con questi header?

Codice PHP:
http.setRequestHeader("Content-type""application/x-www-form-urlencoded"); http.setRequestHeader("Content-length"dati.length); 
http.setRequestHeader("Connection""close"); 
io ti consiglio di usare un bel framework, tipo jQuery