topical media & game development

talk show tell print

server-webapi-code-04-feed.php / php



  <?php
          header("Content-Type: text/xml");
  ?><rss version="2.0"> 
    <channel> 
      <language>en</language> 
      <title>Simple Blog</title>
      <description>My Simple blog example.</description> 
      <link>example.preinheimer.com/blog/<image> 
        <title>Simple Blog Logo</title> 
        <link>example.preinheimer.com/feed1.php<url>example.preinheimer.com/feed1.png</image><?php
      include("./common_db.php");
      query = "SELECT subject, id, post, email, name, category, 
      DATE_FORMAT(date,'\%a, \%d \%b \%Y \%T EST') as date
      FROM 03_simple_blog ORDER BY id DESC";
      recipies = getAssoc(query);
      url = "http://example.preinheimer.com/blog/index.php?post=";
      foreach(recipies AS item)
      {
        echo "<item>\n";
        echo "<title>{item['subject']}</title>\n";
        echo "<link>url{item['id']}</link>\n";
        echo "<description>{item['post']}</description>\n";
        echo "<author>{item['email']}</author>\n";
        echo "<category>{item['category']}</category>\n";
        echo "<pubDate>{item['date']}</pubDate>\n";
        echo "</item>\n";
      }
      echo "</channel>\n</rss>";
    
  ?>


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.