Well, ok - I have a webpage, where I intend to create an RSS feed for the news-items on the front page. The news items on the front page is updated via the admin panel on the page (ie, manually) whenever a person with admin rights decide to write something. I have a working rss.php-file, which outputs a valid rss-feed - the problem I'm having is that whenever I update the front page with news, the rss-feed doesn't "trigger" - I'm assuming that is because I actually have to use the rss.php-file to generate the feed before it is updated. Not very user-friendly, mind. What I'm looking for is a way to either include the script I'm already using in the posting of the news from the admin page, or trigger the rss.php file to run and generate an updated feed whenever I post stuff. I've been looking at RSS-tutorials and whatnot for most of the night, but haven't really found anything about how to trigger, or refresh, the actual file - most tutorials are very generic, and doesn't really cover what I'm after. I'll post a copy of the actual script I'm using, obfuscating some items for security purposes, but the script itself is the same: <?php include ('db_login.php'); $news_items = "SELECT * FROM $news WHERE (ni_expire>='$date' OR ni_expire='0000-00-00') ORDER BY `ni_date` DESC LIMIT 15"; $result=mysql_query($news_items); $num=mysql_numrows($result); $channel = array("title" => "News", "description" => "An RSS-feed.", "link" => "http://www.whateveryourdomain.nothing"); $output = '<?xml version="1.0" encoding="utf-8" ?>'; $output .= '<rss version="2.0">'; $output .= "<channel>"; $output .= "<title>" . $channel["title"] . "</title>"; $output .= "<description>" . $channel["description"] . "</description>"; $output .= "<link>" . $channel["link"] . "</link>"; $i=0; while ($i < $num) { $user_array = mysql_fetch_array($result,MYSQL_BOTH); $output .= "<item>"; $output .= "<title>" . $user_array["heading"] . "</title>"; $output .= "<description>" . $user_array["content"] . "</description>"; $output .= "</item>"; $i++; } $output .= "</channel>"; $output .= "</rss>"; header("Content-Type: application/rss+xml; charset=utf-8"); echo $output; ?> Code (markup):
I think you misunderstand how RSS works. It's up to the client to fetch a new version of the feed when it wants to.
exactly, when client(user)'s browser requests for RSS from your site. it then executes php file to get latest feeds.
I got that after I asked the initial question I actually thought that was how it was done, but my chosen feed-reader wouldn't update the feed, it seemed, no matter what I did - seemed there was a problem with the feed-reader, and not the feed. Testing in Google Reader, and it worked fine.