YeePartheniaa
Newbie
- Apr 29, 2012
- 15
- 0
how to build an RSS thing for a website?
<?phpinclude("system/dbconnect.php");
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Your Site title</title>
<description>Description Here</description>
<link>yoururl()com/</link>';
$query = mysql_query("SELECT * FROM articles ORDER BY id DESC LIMIT 15") or die(mysql_error());
while ($row = mysql_fetch_array($query)){
echo '
<item>
<title>'.$row[title].'</title>
<description><=!=[=C=D=A=T=A=[
'.$row[text].'
]=]=></description>
<link>article link</link>
<pubDate>'.$row[date].' GMT</pubDate>
</item>';
}
echo '</channel>
</rss>';
?>