sending xml object to php
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?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks