Go to full version

Projects On Hex.ro - Questions and Answers > Macromedia Flash XML Tutorial

save.php source code not available for download.

(1/3) > >>

Infiniti Productions LLC:
Is there any way I could take a look at the PHP code on save.php in the flash/php/xml example posted on your site.  I have been looking all day for a tutorial on the topic.

You are the only one.

Thank you so much.

Brian.

viulian:
Thanks for the kind words :)

I've pasted the code below. It is minimalistic so it can be easily adapted to any use..


--- Code: ---<?php
//Capture data from $_POST array
$myxml = $GLOBALS['HTTP_RAW_POST_DATA'];
//Make one big string in a format Flash understand
//Open a file in write mode
$fp = fopen("value.xml", "w");
$ok = fwrite($fp, $myxml);
fclose($fp);

if ($ok)
        header('Location:http://hex.ro/files/flashxml/Display.html');
else
        echo "writing=Error&";

?>
--- End code ---

I'll also update the webpage now..

Infiniti Productions LLC:
thank you.  This is exactly what I needed. You rock.

Infiniti Productions LLC:
Thank you again, The HTTP_RAW_POST_DATA was what I needed.

I was wondering if you could tell me what can be done to the PHP code above to make is so the window does not pop open upon completion of the xml save.  I commented out:

if ($ok)
        header('Location:http://hex.ro/files/flashxml/Display.html');
else
        echo "writing=Error&";


And that made is so display.html does not open (I am only interested in the XML creation), however, a blank window still open and has the path and filename of the .php file.

Again, I thank you so much. You have been very helpful.

Infiniti Productions LLC:
also... how difficult is it to make the new nodes add onto value.xml as apposed to wiping the xml file clean each time?

Navigation

[0] Message Index

[#] Next page