hi all
please let me know how to fetch rss links through php i am getting some error how to fetch news links into website from rss feeds
error coming like this
Warning: Division by zero in D:\xampp\htdocs\rss_reader\index1.php on line 3
Warning: require_once(inc) [function.require-once]: failed to open stream: No such file or directory in D:\xampp\htdocs\rss_reader\index1.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'inc' (include_path='.;\xampp\php\pear\') in D:\xampp\htdocs\rss_reader\index1.php on line 3
<?
header('Content-type: text/xml');
require_once(magi_press/rss_fetch.inc);
?>
<rss version="2.0">
<channel>
<id>Name of your site</id>
<category>A description of your site</category>
<link>http://localhost/sardana/</link>
<url>Your copyright information</url>
<?
$conn=mysql_connect("localhost","root","") or die("cannot connect");
$db=mysql_select_db("studyadda") or die("cannot select db");
$q="SELECT rss_feed_id,rss_feed_cat,rss_feed_title,rss_feed_url AS newsurl
FROM news_rss_url LIMIT 0,15";
$doGet=mysql_query($q);
while($result = mysql_fetch_array($doGet)){
$url = $_GET['url'];
$rss = fetch_rss( $url );
echo "Channel Title: " . $rss->channel['title'] . "<p>";
echo "<ul>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=$href>$title</a></li>";
}
echo "</ul>";
$rss = fetch_rss($result['rss_feed_url']);
?>
<item>
<id> <?=htmlentities(strip_tags($result['rss_feed_id'])); ?></id>
<category> <?=htmlentities(strip_tags($result['rss_feed_cat'],'ENT_QUOTES'));?></category>
<title><?=$result['rss_feed_title'];?></title>
<url> <?php echo $result['rss_feed_url']; ?></url>
</item>
<? } ?>
</channel>
</rss>
//index1.php
using this magpierss library
please help me