# Saving xml with php

**URL:** <https://forum.kirupa.com/t/saving-xml-with-php/206969>\
**Category:** flash\
**Created:** [November 13, 2006, 4:52pm UTC](https://forum.kirupa.com/t/saving-xml-with-php/206969 "2006-11-13T16:52:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fat\_ron](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/fat_ron/32/433_2.png) [@fat\_ron](https://forum.kirupa.com/u/fat_ron)\
**Post date:** [November 13, 2006, 4:52pm UTC](https://forum.kirupa.com/t/saving-xml-with-php/206969/1 "2006-11-13T16:52:29Z")

</div>

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 :

```auto

// 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);
fclose($fp);

```

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