problem with RSS update

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
daninosanto
Forum Newbie
Posts: 4
Joined: Sun Oct 11, 2009 3:59 pm

problem with RSS update

Post 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;)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: problem with RSS update

Post by requinix »

Post code.
User avatar
daninosanto
Forum Newbie
Posts: 4
Joined: Sun Oct 11, 2009 3:59 pm

Re: problem with RSS update

Post 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:)
User avatar
daninosanto
Forum Newbie
Posts: 4
Joined: Sun Oct 11, 2009 3:59 pm

Re: problem with RSS update

Post by daninosanto »

Hey?

No one knows the solution???? :? :(

:
Post Reply