Click to See Complete Forum and Search --> : RSS Error


mayankj22
01-11-2006, 06:28 AM
Hi ,
I am using php script for displaying rssfeed.. But i am getting error , for which i really dont have any idea.

error is: MagpieRSS: Failed to fetch http://rss.news.yahoo.com/rss/topstories (HTTP Error: connection failed ()

When i open this url in browser it works finee...

Following changes I have made in php.ini file..
allow_url_fopen = On (earlier it was off)
register_globals = On (earlier it was off)

Even i have changed proxy settings accordingly in php.ini file..

But the result is same...


So anyone cal help me out!!!

My script code :

<?php
include('rss_fetch.inc');// Set error reporting for this
error_reporting(E_ERROR);// Fetch RSS feed
$rss = fetch_rss('http://rss.news.yahoo.com/rss/topstories');
if ($rss)
{
// Split the array to show first 5
$items = array_slice($rss->items, 0, 5);
// Cycle through each item and echo
foreach ($items as $item )
{
echo '<li><a href="'.$item['link'].'">'.$item['title'].'</a> - '.$item['author'].'</li>';
}}else { echo '<h2>Error:</h2><p>'.magpie_error().'</p>';}
//('error_reporting');
?>

bpat1434
01-12-2006, 06:12 PM
TURN REGISTER GLOBALS OFF!!! That is a HUGE security hole, and you don't need it. Ever.

What does "rss_fetch.inc" look like?

~Brett

rincewind456
01-12-2006, 07:34 PM
Your script worked fine even with register globals off ;)