I do not know how to do rss myself, so I found the code in the internet and did it for myself, but for some reason errors appear. Checked through the validator rss site http://validator.w3.org/feed/. Enter this site draw-art.ru/rss/rss_me.php and errors will pop up there, if necessary, I can post errors here.

Added.

<?php header("content-type: application/rss+xml"); include "db.php"; echo " <?xml version=\"1.0\" encoding=\"windows-1251\"?> <rss version=\"2.0\"> <channel> <title>сайт о рисовании</title> <link>http://www.draw-art.ru</link> <description>Новости о поступлении новых уроков по рисованию,фотошоп,matte-painting,и новости моего блога</description> <language>ru</language>"; $result = dbquery("SELECT date FROM blog ORDER BY date DESC LIMIT 0,1"); $data = dbarray($result); $lnd = $data['date']; $upldt = date("r", $lnd); // конвертация даты в формат RFC 2822 echo "<lastBuildDate>$upldt</lastBuildDate> "; $result = dbquery("SELECT * FROM blog ORDER BY id DESC LIMIT 0,10"); while ($data = dbarray($result)) { echo "<item> "; echo "<title>" . $data['title'] . "</title> "; echo "<link>http://www.draw-art.ru/blog_look.php?id=" . $data['id'] . "</link> "; echo "<description>" . $data['description'] . "</description> "; $nd = $data['date']; $updt = date("r", $nd); echo "<pubDate>$updt</pubDate> "; echo "<guid>http://www.draw-art.ru/blog_look.php?id=" . $data['id'] . "</guid> "; echo "</item> "; } echo "</channel> </rss>"; ?> 
  • Put rss_me.php here, there’s no psychic here, as far as I know. - zevs
  • error is somewhere in the script, it does not even start (maybe somewhere you missed a quotation mark) - KoVadim

1 answer 1

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/p45291/www/draw-art.ru/rss/rss_me.php on line 4

At the very beginning, replace your part of the code with the one that I give below.

 echo ' <?xml version=\"1.0\" encoding=\"windows-1251\"?> <rss version=\"2.0\"> <channel> <title>сайт о рисовании</title> <link>http://www.draw-art.ru</link> <description>Новости о поступлении новых уроков по рисованию,фотошоп,matte-painting,и новости моего блога</description> <language>ru</language>'; 
  • it helped, only then other errors came out (: it’s easier to find a new script, it’s easier to find a new one, don’t tell me where there is a normal php. - kvins
  • there is such a mistake. This feed does not validate. 'utf8' codec can't decode bytes in position 90-93: invalid data (maybe a high-bit character?) Help line 3, column 0: XML parsing error: <unknown>: 3: 0: XML or text declaration not at start of entity help - kvins
  • replace windows-1251 with utf-8 - KoVadim