<?php header('Content-type: text/xml'); ?> <rss version="2.0"> <channel> <title>Title</title> <description>Description</description> <link>http://link.com/</link> <copyright>All material copyright 2006 their respective owners</copyright> <?php PHP code pulls data from db ?> <item> <title> <?php echo $myrow['title']; ?></title> <description> <?php echo $myrow['teaser']; ?></description> <link>http://link.com/index.php?id=<?php echo $myrow['id']; ?></link> </item> <?php } ?> </channel> </rss>
Now, I know this feed works, as it's basically the same code I have on a different site, and there are no problems displaying the RSS feed. On this site, however, when you click on the XML link, it takes you to the XML page, only all the PHP code is sitting there, completely unparsed.
Is there something the site's server might not be capable of doing that is causing this problem? Or am I not including something I should be? Help!