All I'm trying to do is to get xml file content, show is in the textarea and update the file content if the for is submited. I use this code:
$fname = "../data.xml";
if (isset($_POST["update"])) {
$content = $_POST["update"];
$fhandle = fopen($fname,"w");
fwrite($fhandle,$content);
}
$fhandle = fopen($fname,"r");
$content = fread($fhandle,filesize($fname));
fclose($fhandle);
The content is updated when I press submit but it adds slashes to quotes. For example this code:
<?xml version="1.0" encoding="utf-8"?>
becomes:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
and if I re-submit:
<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
Can anyone please tell what am I doing wrong?
Thanks in advance