Queste sono le funzioni javascript:
codice:
<script type="text/javascript">
function assegnaXMLHttpRequest() {
	var
		XHR = null,
		browserUtente = navigator.userAgent.toUpperCase();
	if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
		XHR = new XMLHttpRequest();
	else if(window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0) {
		if(browserUtente.indexOf("MSIE 5") < 0)
			XHR = new ActiveXObject("Msxml2.XMLHTTP");
		else
			XHR = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return XHR;
};

function invia() {
	form_pulsante = document.getElementById("pulsante");
	form_testo = document.getElementById("testo");
	div_risposta = document.getElementById("risposta");
	
	ajax = assegnaXMLHttpRequest();
	if(ajax) {
		pulsante.disabled = true;
		div_risposta.innerHTML = "[img]attesa.gif[/img] Operazione in corso...";
		dati = form_testo.value;
		ajax.open("POST", "richiesta.php", true);
		ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajax.setRequestHeader("Content-length", dati.length); 
		ajax.setRequestHeader("Connection", "close");

		ajax.send(dati);

		ajax.onreadystatechange = function() {
			if(ajax.readyState == 4) {
				div_risposta.innerHTML = ajax.responseText;
				pulsante.disabled = false;
			}
		}
	}
}
</script>
Questo è il codice HTML della pagina, campo nel quale viene inserito il testo e div per la risposta
codice:
<input id="testo" type="text">
<input id="pulsante" type="button" value="Invia" onClick="invia();">


<div id="risposta">
</div>
E infine il codice PHP della pagina che legge i dati in arrivo
codice:
<?php
print_r($_POST);
?>
E questa è la risposta:

Array ( )