Saving xml with php

Hello, I have used the script provided in kirupa’s xml tutorials to save xml files successfully but I want to expand them so that flash can pass the filename to the script at runtime? Here’s the current script im using to save xml data to a predefined xml file :

// in flash :
my_xml.sendAndLoad("saveXML.php", my_xml);

// in php :
$filename = "myXML.xml";
$raw_xml = file_get_contents("php://input");
print $raw_xml;
$fp = fopen($filename, "w");
fwrite($fp, $raw_xml);

So basically I want flash to supply the $filename variable. any suggestions?