How do i pass a variable in the 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"); ' it fills the database with str but not with hello
I tried these not working
xmlhttp.send("fname=" +str,"lname=" +cool);
it fills the fname with variable value but not lname, lname gives an empty string how do i combine if i have many variables to pass on ?
1 Answer