PHP file_get_contents not working with external URL
I have a php app that reads an rss file and displays it as a ticker. When
I use a local file it works fine, but when I put the same file xml on a
different web server, it won't read it.
I'm running on a Mac 10.6 server and allow_url_fopen is On in the php.ini
file.
Here is a snippet of my php code:
$RSSURL= $_GET["URL"];
if(isset($RSSURL))
$rss=file_get_contents("http://snsapp1.sns.ornl.gov/terracotta/signlinks/POD.xml");
if(isset($rss)&&($rss<>false)) {
// echo ticker content to page
}
else {
$msg="<item><header>Error! - Check supplied URL location - File not
found!</header>";
// echo error message to page
}
No comments:
Post a Comment