I've been attempting to send an xml file to a PHP script, for quite sometime
...all in vain.
I've verified that my PHP script works, by submitting from a barebones web
form. Effectively, all it does is step through each POST key and prints the
value.
When I attempt to send xml data to the script: using myXML.send("url",
"_blank"); the page that is opens showing the results is always blank. (No
source what so ever).
What's more, I have attempted to use myXML.sendAndLoad("url", myreceivedXML)
-- and the myreceivedXML object is always null or blank. (When it should be an
fairly exact copy of my original xml document that I sent.)
Here is my flash code.
_global.map_xml = new XML();
_global.map_xml.ignoreWhite = true;
_global.map_xml.contentType = "text/xml";
_global.map_xml.xmlDecl = "xml=";
_global.map_xml.onLoad = function(success:Boolean){
if (success) {
_global.map_xml.send("
http://blaqestnight.com/map/map.php", "_blank");
}
}
_global.map_xml.load("values.xml");
Here's my PHP script:
// Print test 1
$somecontent = $_POST['xml'];
print $somecontent;
print $_POST['xml'];
//Print test 2
foreach ($_POST as $value) {
Print $value;
}
The initial load is always successfull. I'm able to use the xml object to
initialize, but I'm trying to hand it off to the PHP script to write to disk
...and it never seems to be receiving it.
In another forum, it was mentioned that by putting the "xml=" in the
XML.xmlDecl property, you would be able to access the xml through $_POST['xml']
..without having to enable $HTTP_RAW_POST_VAR.