# Saving and loading different xml´s?

**URL:** <https://forum.kirupa.com/t/saving-and-loading-different-xml-s/203155>\
**Category:** Uncategorized\
**Created:** [October 8, 2006, 1:19pm UTC](https://forum.kirupa.com/t/saving-and-loading-different-xml-s/203155 "2006-10-08T13:19:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Genialiteten](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@Genialiteten](https://forum.kirupa.com/u/Genialiteten)\
**Post date:** [October 8, 2006, 1:19pm UTC](https://forum.kirupa.com/t/saving-and-loading-different-xml-s/203155/1 "2006-10-08T13:19:13Z")

</div>

Hi…

I am working on an advanced slideshow player width seperate editor. The editor is based on the code for Kirupas great news editor: [http://www.kirupa.com/web/xml/examples/newseditor.htm](http://www.kirupa.com/web/xml/examples/newseditor.htm) But in my slideshow editor i need to save and load different xml-files width different names. :puzzled:

In Flash the most important code looks like this:   
[COLOR=RoyalBlue]  
var xml\_file = “slides.xml”;  
\_global.xml\_file\_link = xml\_file;  
var save\_script = “slides\_save.php”;

var slides\_xml = new XML();  
slides\_xml.ignoreWhite = true;  
slides\_xml.contentType = “text/xml”;  
slides\_xml.onLoad = function(success){  
if (success){  
ShowSlides(this);  
}  
else link\_txt.text = “\*\*\* Error loading XML file \*\*\*”;  
}

RefreshSlides(slides\_xml);

SaveSlides = function(slides\_xml){  
data\_box.content\_txt.htmlText = “\<i\>Saving and Loading…\</i\>”;  
slides\_xml.xmlDecl = “”; // fixes duplication bug  
slides\_xml.sendAndLoad(save\_script, slides\_xml);  
}  
RefreshSlides = function(slides\_xml){  
data\_box.content\_txt.htmlText = “\<i\>Loading…\</i\>”;  
slides\_xml.load(xml\_file+"?"+new Date().getTime());  
}[/COLOR]

The php code:

[COLOR=RoyalBlue]\<?php  
$filename = “slides.xml”;  
$raw\_xml = file\_get\_contents(“php://input”);

print $raw\_xml;

$fp = fopen($filename, “w”);  
fwrite($fp, $raw\_xml);  
fclose($fp);  
?\>[/COLOR]

I belive the answer is to send a var to php insted of the static name “slides.xml” But i cant get anything to work. Anyone knowing what to do here!? Any help would be genious! :sure:
