Здравейте! Използвам този урок за rss новини, но те не излизат. Ето кода:
Код:
<?php
$db_user = "root"; // db username
$db_pass = ""; // db password
$db_host = "localhost"; // db host
$db = "****"; // db
$adminmail = "****"; // administrator e-mail
$websitetitle = "****"; // title of your website
$website = "****";
$rssdescr = "****";
$year = "2010";
?>
<?php
header ("Content-type: text/xml");
echo ("<?xml version=\"1.0\" encoding=\"windows-1251\"?>\n");
?>
<rss version="2.0">
<channel>
<title>***</title>
<link><?php echo "$website";?></link>
<description><?php echo "$rssdescr";?></description>
<copyright>(c) <?php echo "$year"; ?> Web-Journal Links Indexing</copyright>
<ttl>60</ttl>
<language>bg-BG</language>
<webMaster><?php echo "$adminmail";?></webMaster>
<?php
mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($db) or die( "Unable to select database");
$result = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 25") or die (mysql_error());
while ($row = mysql_fetch_array ($result)) {
echo "<item>
<title>";
echo $row['title'];
echo "</title>";
echo "<link>";
echo "rss.php?id=$row[id]";
echo "</link>";
echo "<description><![CDATA[ ";
echo $row['news'];
echo "] ]> </description>";
echo "
</item>";
}
mysql_free_result ($result);
?>
</channel>
</rss>