zhangy Posted February 5, 2009 Share Posted February 5, 2009 Hi, I'm having problems with this php driven rss feed. So far it loads the page title and description but the actual links in the feed don't show up; as seen here: http://eslassembly.com/test-feed.php Can anyone see whats wrong in this code? <?php header("Content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; // Set RSS version. echo " <rss version=\"2.0\"> "; // Start the XML. echo " <channel> <title>ESL Assembly.com | Recent Job Openings</title> <description>Follow the list of our most recent job posts for teaching English as a second language.</description> <link>http://www.eslassembly.com/</link>"; // Create a connection to your database. require("php/Load.php"); if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); // Query database and select the last 10 entries. $data = mysql_query("SELECT * FROM $table ORDER BY submission_id DESC LIMIT 10"); while($row = mysql_fetch_array($data)) { // Continue with the 10 items to be included in the <item> section of the XML. echo " <item> <link>http://www.eslassembly.com/jobsDisplay.php?id=".$row[sub_id]."</link> <guid isPermaLink=\"false\">http://www.eslassembly.com/jobsDisplay.php?id=".$row[sub_id]."</guid> <title>".$row[col_A]."</title> <description><![CDATA[".substr($row[col_B],0,450)."]]></description> </item>"; } echo " </channel> </rss>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/143904-solved-dynamic-rss-feed-problem/ Share on other sites More sharing options...
JonnoTheDev Posted February 5, 2009 Share Posted February 5, 2009 Your XML is invalid Quote Link to comment https://forums.phpfreaks.com/topic/143904-solved-dynamic-rss-feed-problem/#findComment-755124 Share on other sites More sharing options...
zhangy Posted February 6, 2009 Author Share Posted February 6, 2009 Sorry, I know next to nothing about xml. Is there something specific I can change in order to make it valid? Quote Link to comment https://forums.phpfreaks.com/topic/143904-solved-dynamic-rss-feed-problem/#findComment-755640 Share on other sites More sharing options...
zhangy Posted February 6, 2009 Author Share Posted February 6, 2009 Your XML is invalid I've gone over and over it and everything looks copacetic. I also put it into the w3c xml validator which resulted with no errors. ??? Quote Link to comment https://forums.phpfreaks.com/topic/143904-solved-dynamic-rss-feed-problem/#findComment-755740 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.