In a current project, I used part of Kirupa’s Introduction to XML tutorial that showed how to update XML by sending data from Flash to PHP, which would write to the XML file. However, I can’t get it to work for me, and having no knowledge of PHP, I just need to know if the following code should work, so that I can figure out which part of the communication isn’t working. It’s supposed to receive data from a Flash file in the same directory, then send it to an XML file called “data.xml”, also in the same directory.
<?php
$filename = "data.xml";
$raw_xml = file_get_contents("php://input");
print $raw_xml;
$fp = fopen($filename, "w");
fwrite($fp, $raw_xml);
fclose($fp);
?>
Thanks for your help. Here’s the tutorial I mentioned.
http://www.kirupa.com/web/xml/examples/simpleeditor.htm