I want to be able to load an xml file from my server. Edit a node in the xml with jQuery and then save this change with the rest of the xml file back to the server using php. Anyone know how to do this? I have code that changes the xml node and can see this in my console. But cannot get the code back to my server.
Thanks!
<?php
$xml = $_POST['xml'];
$file = fopen("data.xml","w");
fwrite($file, $xml);
fclose($file);
?>
$.post('saveXml.php', { xml: $(data)}, function(data){alert('data loaded');});
if I console.log(data) I get #document and all the xml nodes. I also get the data.xml file on my server but it's blank.