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 :
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
<?xml version="1.0" standalone="yes"?>
<news>
<title>Programa PDF</title>
<thetext>Avaliação PDF</thetext>
<author>Introdução</author>
</news>