ajax - How do i pass a variable in the xmlhttp.send function -


how pass variable in xmlhttp.send function

var str = "hello" xmlhttp.open("post","./omnama.php",true); xmlhttp.setrequestheader("content-type","application/x-www-form-urlencoded"); xmlhttp.send("fname=+str"); ' fills database str not hello 

i tried these not working

 xmlhttp.send("fname=" +str,"lname=" +cool);  

it fills fname variable value not lname, lname gives empty string how combine if have many variables pass on ?

xmlhttp.send("fname=" + str); should work  xmlhttp.send("fname=" +str + "&lname=" +cool); 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -