Question : passing multiple values using xmlhttp.send

I am using the script below to pass values from a form to a php page.  The first xmlhttp.send always returns a value, the second one is always blank. I am trying to figure out how to send multiple values using xmlhttp.send
1:
2:
3:
4:
5:
6:
7:
8:
9:
if(xmlhttp) { 
  	var txtname = document.getElementById("txtname");
	var number  = document.getElementById("number");
    xmlhttp.open("POST","testing.php",true); //calling testing.php using POST method
    xmlhttp.onreadystatechange  = handleServerResponse;
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send("txtname=" + txtname.value); //Posting txtname to PHP File
	xmlhttp.send("number=" + number.value); //Posting number to PHP File
  }

Answer : passing multiple values using xmlhttp.send

what about :

1:
2:
3:
4:
5:
xmlhttp.send("txtname=" + txtname.value + "&number=" + number.value);

or

xmlhttp.send("txtname=" + encodeURI(txtname.value) + "&number=" + encodeURI(number.value));
Random Solutions  
 
programming4us programming4us