View Full Version : XML to PHP _ PHP to XML

06-03-2007, 02:37 AM
Hi : )

I have a swf (flash application) that can send an
XML file to a specified URL. (say www.test.com/ad_querry.php )

Is it possible to create a PHP code that would

1) Fetch and read the XML file as it is sent from the flash application

2) Execute an SQL querry given some information located in the XML file.
(let say add a name and vote number to a database)

3) Reconstruct an XML file given the new updated information (let say the new average of all the vote)

4) Send back the file to the specified client.

Thanks !!

06-03-2007, 10:23 AM

All you listed above can be found in the DOM (http://ca3.php.net/manual/en/ref.dom.php) functions (DOMXML covers some of this if your version is < 5) on the api. Hopefully you have php 5.0 as the DOM is built into the core while the DOMXML functions of php 4 are both weaker and need to be added and configured.
As with your last point, to my knowledge there is no way to force it. Passing xml to flash is not my specialty in the least.
Normally if you simply read and write to a file, I don't believe you can signal another application using php that its complete. PHP can manipulate the file that the flash has generated, but its up to the flash to update its values. There may be a way to sorta stream the xml data into the flash, but I'm not certain on that one.
As long as you can write the actionscript or at least know how it functions, you should be able to generate your new data.