I was browsing through other questions and posts but couldn't find the answer.
I need to send data to PHP file which saves the data to the server. Some of the data is just string variables and one of the variables is XML data. I tried to do it with the following code:
$.post(
"save.php",
{
userId: _UserId,
pName: _pName,
pId: _pId,
xml: $(_xml).find("main").text()
},
function () {
console.log("Saved");
}
);
So _xml is an XML document and I am trying to save the entire XML in the server. The POST works but the problem is that it saves only the text, without the <> brackets.
How do I properly send the XML data to the server? Any help will be appreciated.