I’m trying to create a forum using Actionscript, XML, and PHP. I’ve read senocular’s XML tutorial, and am actually using bits of his code. I understand the concepts and the syntax. However, when I send out the XML object from flash, my PHP script will not save the raw GET data in my XML file. Yes, the PHP script is on the server where it should be. And other PHP scripts work. All the necessary files were uploaded. I’m 99.9% is simply a question of syntax or omission. My Actionscript is written as follows:
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.contentType = "text/xml";
my_xml.onLoad = function(success) {
if (success) {
var my_element = my_xml.createElement("bob");
my_element.send(forum_save.php);
_root.gotoAndStop(2);
}
};
my_xml.load("my_document.xml");
My PHP script is written as follows:
<?php
$filename = "my_document.xml";
$raw_xml = file_get_contents("php://input");
print $raw_xml;
$fp = fopen($filename, "w");
fwrite($fp, $raw_xml);
fclose($fp);
?>
Your thoughts are much appreciated!