# sendAndLoad problem

**URL:** https://forum.kirupa.com/t/sendandload-problem/60237
**Category:** flash
**Created:** [August 8, 2004, 3:27am UTC](https://forum.kirupa.com/t/sendandload-problem/60237 "2004-08-08T03:27:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Dulcinea](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@Dulcinea](https://forum.kirupa.com/u/Dulcinea)
#### Post date: [August 8, 2004, 3:27am UTC](https://forum.kirupa.com/t/sendandload-problem/60237/1 "2004-08-08T03:27:27Z")

</div>

this is a simple test code to send and load xml data from a flash movie:  
[AS]tgXML = new XML("\<data\>\<m nick=“Adela” colour=“000000”\>Nuevo%20tagboard%2C%20pueden%20escribir%20lo%20que%20quieran%20sobre%20la%20p%C3%A1gina%20aqu%C3%AD%2E\</m\>\<m nick=“io” colour=“ff0000”\>Nuevo%20mensaje%20escrito%20por%20mi\</m\>\</data\>");  
tgXML.ignoreWhite = true;  
tgRecipiente = new XML();  
tgRecipiente.ignoreWhite = true;  
tgRecipiente.onLoad = function(){  
campo.text = tgRecipiente.firstChild;}  
tgXML.sendAndLoad(“escribidor.php”,tgRecipiente);[/AS]  
its very similar to the one of the xml guestbook in this site, and because I copied the whole php script from there, there’s nothing wrong with it.  
the problem is that this script **isn’t sending anything** and everytime i run it it ereases the xml file. WHY???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 8, 2004, 3:52am UTC](https://forum.kirupa.com/t/sendandload-problem/60237/2 "2004-08-08T03:52:39Z")

</div>

which php script is that?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 8, 2004, 4:34am UTC](https://forum.kirupa.com/t/sendandload-problem/60237/3 "2004-08-08T04:34:44Z")

</div>

```php
<?php
$xmlString = $HTTP_RAW_POST_DATA;
if($xmlString != NULL){
$file = fopen("tagboard.xml", "w+") or die("Can't open XML file");
if(!fwrite($file, $xmlString)){
	print "Error writing to XML-file";
}
print $xmlString."
";
fclose($file);}
else {print "no data was sent";}
?>

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 8, 2004, 4:40am UTC](https://forum.kirupa.com/t/sendandload-problem/60237/4 "2004-08-08T04:40:59Z")

</div>

try replacing $HTTP\_RAW\_POST\_DATA; with readfile(“php://input”); and see if that helps

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 8, 2004, 4:45am UTC](https://forum.kirupa.com/t/sendandload-problem/60237/5 "2004-08-08T04:45:25Z")

</div>

ooooooo you’re a genius!!! it worked  
but why?  
the other code used to work with the guestbook
