Quote database webapp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rss.php 902B

12345678910111213141516171819202122232425262728293031323334
  1. <?PHP
  2. require_once('inc/database.php');
  3. header('Content-type: text/xml');
  4. $sql = 'SELECT quote_id, quote_quote, quote_rating FROM quotes ';
  5. if (isset($_GET['id'])) {
  6. $sql .= 'WHERE quote_id = ' . ((int) $_GET['id']) . ' ';
  7. }
  8. $sql .= 'ORDER BY quote_id DESC LIMIT 0,25';
  9. $res = mysql_query($sql)
  10. ?>
  11. <?PHP echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
  12. <rss version="2.0">
  13. <channel>
  14. <title>Quote db</title>
  15. <link>http://apps.MD87.co.uk/quotes/</link>
  16. <description>Latest quotes from the quote database</description>
  17. <?PHP
  18. while ($row = mysql_fetch_array($res)) {
  19. echo '<item><title>Quote '.$row['quote_id'].'</title>';
  20. echo '<guid isPermaLink="true">http://apps.MD87.co.uk/quotes/browse?q='.$row['quote_id'].'</guid><description><![CDATA[';
  21. echo nl2br(htmlentities($row['quote_quote'], ENT_QUOTES, 'UTF-8'));
  22. echo ']]></description></item>';
  23. }
  24. ?>
  25. </channel>
  26. </rss>