[請益]提供RSS訂閱問題

看板PHP作者 (小貓)時間16年前 (2009/08/07 14:42), 編輯推噓1(103)
留言4則, 2人參與, 最新討論串1/1
請問各位大大們 執行以下rss程式,是正常的。可以撈出很多筆資料(訂閱文章前的畫面) 例如:可以撈出資料庫裡blog的前10筆文章 但是問題來了!! 只要我按下 (訂閱此摘要) 在摘要那裡卻怎麼樣都只會顯示出一筆資料而已。(訂閱後的畫面) PS: 我的瀏覽器是使用ie8 煩請各位大大 救救我 <? echo '<?xml version="1.0" encoding="utf-8" ?>'; //get the news you want to display include("Db.inc.php"); $getnews = "select * from db_rss where if_subject = 'T' order by del_serial ASC "; $res = & $mdb2->query($getnews); if(PEAR::isError($res)) die('查詢失敗' . $res->getMessage()); ?> <rss version="2.0"> <channel> <title>Aman la vida</title> <link>http://127.0.0.1/xxxxx/index.php</link> <docs>http://blogs.law.harvard.edu/tech/rss</docs> <description>Aman la vida</description> <? while($r = $res->fetchRow()){ extract($r); //clean the news form unwanted chars $news_day=stripslashes($postdate);//公告日期 $news_title=stripslashes($subject);//公告標題 $news_message=preg_replace("/(<\/?)(\w+)([^>]*>)/e"," ", $message); //公告內容(remove html tags because they return errors) ?> <item> <title><?=$news_title?></title>  <description><?=$news_message?></description> <link>http://127.0.0.1/xxxxxxx/showpost.php?page=<?=urlencode($news_title)?></link> <pubDate><?=$news_day;?></pubDate> <guid>http://127.0.0.1/xxxxx/rss_2.php</guid> </item> <? }?> </channel> </rss> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.30.167

08/08 09:48, , 1F
要不要試試看用現成的rss lib?
08/08 09:48, 1F

08/08 12:18, , 2F
這位大大可以提供rss lib的參考文獻嗎?
08/08 12:18, 2F

08/08 12:18, , 3F
因為我也是查了很久,才找到上面的寫法。
08/08 12:18, 3F

08/08 19:33, , 4F
非常感謝,我以解決問題了!!
08/08 19:33, 4F
文章代碼(AID): #1AUyplW5 (PHP)
文章代碼(AID): #1AUyplW5 (PHP)