Click to See Complete Forum and Search --> : Solution: Gettting External XML data using PHP

07-12-2001, 10:23 PM
I know a number of you have trouble getting data from a external source such as moreover.com, but can't run there flash pages on their web page due to the security set up within flash.

The following code will allow you get XML from moreover.com and display it locally. It uses PHP to run this code:

[?php header ("Content-Type: text/xml"); ?]
// get a web page into a string
$fcontents = join ('', file ('http://p.moreover.com/cgi-local/page?c=Developer%20news&o=xml'));
echo $fcontents;

I have replaced the angle brackets with square brackets. If you want a clean copy of the code you can get it from:


and see the code running at:


This code runs for me on both the Win32 and Linux versions of PHP.

I am also looking at providing a similar solutions for:

Java Servlets:
Modules on Apache:
Shell Scripting:

If you want me to provide you with a solution on any of these platforms please let me know as I am doing them in no particular order.

Once I have done all these I will post them to the Flash-XML FAQ that is being built at the moment.