Hi,
I need to send username received from html to php as xml object. There is some problem in my code.
function adduser()
{
uname = document.getElementById(“uname”).value;
alert(uname);
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert (“Browser does not support HTTP Request”)
return
}
var url=”sendxml.php”
param = “<profile>” +”<username>”+escape(uname)+”</username>”+”</profile>”
xmlstring=xmlToString(param);
alert(“entered”);
alert(xmlstring);
xmlHttp.setRequestHeader(“Content-Type”,”application/x-www-form-urlencoded”)
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open(“POST”,url,true)
xmlHttp.send(“param=”+xmlstring)
}
function xmlToString(xmlObj) {
if (navigator.appName == “Netscape”)
{
return (new XMLSerializer()).serializeToString(xmlObj);
}
if (navigator.appName == “Microsoft Internet Explorer”)
{
return xmlObj.xml;
}
}
Can anybody help me?