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
Post a Comment