var http = getHTTPObject(); // We create the HTTP Object

function getHTTPObject() {
	var xmlhttp;

	if(window.XMLHttpRequest){
		xmlhttp = new XMLHttpRequest();
	}

	else if (window.ActiveXObject){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if (!xmlhttp){
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	}
	return xmlhttp;
}

function handleHttpResponse() {
	if (http.readyState == 4) {
		if(http.status==200) {
			var results=http.responseText;
			document.getElementById('formbox').innerHTML = results;
		}
	}
}

function submitForm() {
	params = '?last_name='+document.getElementById('last_name').value;
	params += '&first_name='+document.getElementById('first_name').value;
	params += '&email='+document.getElementById('email').value;

	http.open("GET", 'enterData.php'+params, true);
	http.onreadystatechange = handleHttpResponse;
	http.send(null);
}