我想从RSS阅读器访问内容。 我有阅读器的php页面的以下代码
<?php
try {
$pdo = new PDO('mysql:host=localhost;dbname=k;charset=utf8', '', '', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}
$myFile = "rss.xml";
$fh = fopen($myFile, 'w') or die("can't open file");
$rss_txt ='';
$rss_txt .= '<?xml version="1.0" encoding="utf-8"?>';
$rss_txt .= "<rss version='2.0'>";
$rss_txt .= '<channel>';
$rss_txt .='<title>karolos.upatras.gr</title>';
$rss_txt .='<link>localohost/rss.php</link>';
$rss_txt .='<description>Latest Reports</description>';
echo "<pre>";
var_dump($myFile);
echo "</pre>";
$query = "SELECT * FROM spots ORDER BY created_at DESC LIMIT 20";
$query->execute();
$results1 = $query->fetchAll( PDO::FETCH_ASSOC );
foreach( $results1 as $row )
{
$id =$row['id'];
$rss_txt .= '<item>';
$rss_txt .= '<title>' .$row['title']. '</title>';
$rss_txt .= '<link>http:/repot_profile.php?id='.$id.'</link>';
$rss_txt .= '<description>' .$row['description'] .$row['area']. '</description>';
$rss_txt .= '</item>';
echo "<pre>";
var_dump($row['id']);
echo "</pre>";
echo "<pre>";
var_dump($row['description']);
echo "</pre>";
}
$rss_txt .= '</channel>';
$rss_txt .= '</rss>';
fwrite($fh, $rss_txt);
fclose($fh);
header('Location: rss.xml');
?>
* report_profile.php是一个显示报告统计信息的网页 你能帮忙我如何将这些链接到我的索引文件,以便RSS阅读器可以访问它并将这些行作为RSS提要
我是RSS,PHP,HTML等的新手。所以也许这是一个愚蠢的问题,但我真的很难找到关于RSS的文档,主要是找到RSS阅读器或嵌入RSS馈送器