vynsane Posted July 12, 2007 Share Posted July 12, 2007 i've been working on a script that would generate an RSS feed, and that seems to work, it displays the feed in FireFox the way it should, but when i try to link to it as a live bookmark or aggregate it in thunderbird, it claims it to not be a valid feed. here's the feed: http://www.wallcrawlersweb.com/news/feed/news.rss and here's the script that generates it: $fp = fopen ("news.rss", "w"); fwrite ($fp, "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"); fwrite ($fp, "\t<rss version=\"2.0\">\n"); fwrite ($fp, "\t\t<channel>\n"); fwrite ($fp, "\t\t\t<title>WallCrawlersWeb.com - Spider-man News</title>\n"); fwrite ($fp, "\t\t\t<link>http://www.WallCrawlersWeb.com/news/</link>\n"); fwrite ($fp, "\t\t\t<description>News from all aspects of Spider-man collecting: Comics, Movies, Toys, Collectibles, Television, Video Games</description>\n"); fwrite ($fp, "\t\t\t<language>en-us</language>\n"); fwrite ($fp, "\t\t\t<docs>http://www.WallCrawlersWeb.com/news/feed/news.rss</docs>\n"); (database connection deleted) $newsQuery = "SELECT Members.username, NewsCat.catName, NewsItem.* FROM Members, NewsCat, NewsItem WHERE NewsItem.category = NewsCat.ID AND Members.id = NewsItem.Members_id ORDER BY NewsItem.id DESC"; $newsobject = mysql_query($newsQuery) or die(mysql_error()); while ($row = mysql_fetch_array($newsobject)) { $newsCat = $row['catName']; $title = stripslashes($row['title']); $teaser = stripslashes($row['preview']); $ID = $row['id']; $username = $row['username']; fwrite ($fp, "\t\t\t<item>\n"); fwrite ($fp, "\t\t\t\t<title>$newsCat: $title</title>\n"); fwrite ($fp, "\t\t\t\t<description>$teaser</description>\n"); fwrite ($fp, "\t\t\t\t<link>http://www.WallCrawlersWeb.com/news/article/$ID</link>\n"); fwrite ($fp, "\t\t\t</item>\n"); } fwrite ($fp, "\t\t</channel>\n"); fwrite ($fp, "\t</rss>\n"); fclose ($fp); is there something wrong in my script? should i get rid of the tab and newline regexes? Link to comment https://forums.phpfreaks.com/topic/59571-solved-rss-feed-creator-problem-not-valid-rss-feed/ Share on other sites More sharing options...
trq Posted July 12, 2007 Share Posted July 12, 2007 A quick run through the w3c org validator shows all your errors. Link to comment https://forums.phpfreaks.com/topic/59571-solved-rss-feed-creator-problem-not-valid-rss-feed/#findComment-296016 Share on other sites More sharing options...
vynsane Posted July 12, 2007 Author Share Posted July 12, 2007 hrm, yeah... i should'a thought of that. fixed! changed the address, too: www.WallCrawlersWeb.com/news/feed.rss Link to comment https://forums.phpfreaks.com/topic/59571-solved-rss-feed-creator-problem-not-valid-rss-feed/#findComment-296307 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.