Hi all
I have a module on a website which runs the following code to obtain an XML file from a remote host and I display the contents of the feed on my site:
$request = "http://remotewebsite.com/feeds/complete";
$raw_xml = file_get_contents($request);
$fp = fopen($_SERVER['DOCUMENT_ROOT'] . '/feed.xml', 'w') or die("can't open file");
fwrite($fp, $raw_xml);
fclose($fp);
Now when i run this on my live web server, I get an error saying :
failed to open stream: no suitable wrapper could be found in blah blah
and
readfile(): URL file-access is disabled in the server configuration in blah blah
and when I have investigated this it suggests that allow_url_fopen needs to be enabled but all things suggest that this is a big NO NO for security reasons.
So, my question is, how can I obtain the XML feed from the remote host without enabling this PHP variable?
Many Thanks
kbc