I am writing to an XML file which is placed in the src directory of my Flex project. But when I run my application, the changes I make to that XML file actually reflects in the copy of that XML file in my C:\wamp\www\myProject-debug\myXML.xml.
Is there a way to reflect those changes to the actual xml file i.e. the one in the src directory?
Server Side: PHP
PHP file is in the same src folder. Here is the related snippet of code:
.
.
$xdoc = new DomDocument("1.0");
$xdoc->Load('myXML.xml');
$xdoc->preserveWhiteSpace = false;
$xdoc->formatOutput = true;
$xcurrUsers=$xdoc->getElementsByTagName('currentUsers')->item(0);
$xuser=$xdoc->createElement('user');
$xcurrUsers->appendChild($xuser);
.
.
$xdoc->save("myXML.xml");
You should be able to do so by using a relative or absolute path to where you want to save when you call
$xdoc->save(). Since you are currently not providing a path, it is being saved in the current directory.