# Saving data into a xml file

**URL:** <https://forum.kirupa.com/t/saving-data-into-a-xml-file/169233>\
**Category:** flash\
**Created:** [November 14, 2005, 5:17pm UTC](https://forum.kirupa.com/t/saving-data-into-a-xml-file/169233 "2005-11-14T17:17:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bl4ck1c3](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bl4ck1c3](https://forum.kirupa.com/u/bl4ck1c3)\
**Post date:** [November 14, 2005, 5:17pm UTC](https://forum.kirupa.com/t/saving-data-into-a-xml-file/169233/1 "2005-11-14T17:17:25Z")

</div>

Hi ! I am working in a dynamic page that contains data saved in a .xml file, flash load’s it and display it! nothing big deal. But now I was trying to edit the displayed data and save it back pressing a button, on the xml file using php, but i don’t know nothing about php if someone could help I would apreciate ! my code is the following :

```auto
 
function processXMLData(success)
{
if (success)
{
var rootNode=this.firstChild;
var titleNode=findNode(rootNode, "title");
title=getValue(titleNode);
 
var thetextNode=findNode(rootNode, "thetext");
thetext=getValue(thetextNode);
 
var authorNode=findNode(rootNode, "author");
author=getValue(authorNode);
 
}
else
{
p1="Nothing to show";
}
}
function getValue(node)
{
if (node && node.firstChild)
return node.firstChild.nodeValue;
return "";
}
function findNode(node, nodeName)
{
if (node.nodeName==nodeName)
return node;
for (var i=0; node.childNodes && i<node.childNodes.length; i++)
{
var foundNode=findNode(node.childNodes*, nodeName);
if (foundNode!=null)
return foundNode;
}
return null;
}
var xmlData=new XML();
xmlData.ignoreWhite=true;
xmlData.onLoad=processXMLData;
xmlData.load("information.xml");
stop(); 

```

information.xml

```auto

<?xml version="1.0" standalone="yes"?>
<news>
<title>Programa PDF</title>
<thetext>Avalia&#231;&#227;o PDF</thetext>
<author>Introdu&#231;&#227;o</author>
</news> 

```
