Have a rss news feed on my site, and sometimes if the news site is down, I get this message:
Warning: fopen(http://headlinefeeds.news.com.au/servle ... 5&typeid=1): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error in /home/virtual/site107/fst/var/www/html/griffith/scripts/rsslib.php on line 77
could not open XML input
Is there any way I can put a code in my script that checks if the feed is really there and working, and if not display a message like "News feed currently not available"???
Thanx
TOM
Validating fopen
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
$handle = @fopen($url);
if($handle === false)
{
// stream failed connection
}