Page 1 of 1
problem with RSS update
Posted: Sun Oct 11, 2009 4:10 pm
by daninosanto
hi,
I have created PHP RSS feed.Then I decidede to change the title of the feed. but somehow title does not change after changing the PHP code.What's more I have added a new entry to database but the rss stille not changes.
The thing code is doing basically is showing "select * from table1".Showing description and title of each entry.
also do you know a bug that firefox has with rss feed display? The table ahs 2 entries which have titile and description but firefox does not show the description of the last entry.???
Plugin of firefox and safari shows the rss feed right.
Thanks for your any help;)
Re: problem with RSS update
Posted: Sun Oct 11, 2009 4:22 pm
by requinix
Post code.
Re: problem with RSS update
Posted: Mon Oct 12, 2009 2:29 pm
by daninosanto
the file rss.php is as follows which is under podcast directory
Code: Select all
<?php
header("Content-Type: text/xml");
$rssfeed = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
$rssfeed .= "<rss version=\"2.0\">";
$rssfeed .= "<channel>";
$rssfeed .= "<title>Learnall.com RSS Feed</title>"; //I can not change this line
$rssfeed .= "<link>http://learn2all.com</link>";
$rssfeed .= "<description>learnall.com Podcast RSS feed</description>";
$rssfeed .= "<language>en-us</language>";
$rssfeed .= "<copyright>Copyright (C) 2009 learnall.com</copyright>";
$query = "SELECT * FROM podcast";
$result = mysql_query($query) or die ("Could not execute query");
$count=0;
while($row = mysql_fetch_array($result)) {
if($count<5){
$rssfeed .= "<item>";
$rssfeed .= "<title>" . $row['title'] . "</title>";
$rssfeed .= "<description>" . $row['$description'] . "</description>";
$rssfeed .= "<link>http://learnall.com/podcast/podcast_display.php?if_id=". $row['$id'] ."</link>";
$rssfeed .= "<pubDate>" . date("D, d M Y H:i:s O", strtotime($row['$added'])) . "</pubDate>";
$rssfeed .= "</item>";
$count++;
}
}
$rssfeed .= "</channel>";
$rssfeed .= "</rss>";
$filename="rss.xml";
$fh=fopen($filename,"w") or die("can not open file rss.xml");
fwrite($fh,$rssfeed);
fclose($fh);
?>
the first lines of index file under /podcast/index.php
is as follows
Code: Select all
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-9"><title>Podcast</title>
<link rel="alternate" href="/podcast/rss.php" title="Podcast RSS feed" type="application/rss+xml">
<a href="/podcast/rss.xml">RSS</a>
</head><body><div class="span-19 last">
<div class="span-5" style="padding-left: 15px;">
...... <!--continues .....-->
I can not change
anything in this rss.php. Please help me. I did not know what is rss before writing this code now I hate it:)
Re: problem with RSS update
Posted: Fri Oct 16, 2009 2:09 am
by daninosanto
Hey?
No one knows the solution????
: