[eluser]ppwalks[/eluser]
I have followed some instructions on creating an rss feed for my website, I followed the tutorial on net tuts and created a feed in another folder on wamp which works fine, but when I move the files accross to the site I am making the website I cannot view the feed it wants me to download it, this is a new problem that I have never encountered, any help would be appreciated.
controller code
Code:
class Feed extends Controller {
function Feed()
{
parent::Controller();
$this->load->helper('xml');
$this->load->helper('text');
}
function index()
{
$data['feed_name'] = 'MyWebsite.com'; // your website
$data['encoding'] = 'utf-8'; // the encoding
$data['feed_url'] = 'http://localhost/feed'; // the url to your feed
$data['page_description'] = 'What my site is about comes here'; // some description
$data['page_language'] = 'en-en'; // the language
$data['creator_email'] = '[email protected]'; // your email
header("Content-Type: application/rss+xml"); // important!
$this->load->view('rss', $data);
}
}
View code
[code]
<?php echo '<?xml version="1.0" encoding="' . $encoding . '"?>' . "\n"; ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<link><?php echo $feed_url; ?>
<description><?php echo $page_description; ?></description>
<dc:language><?php echo $page_language; ?></dc:language>
<dc:creator><?php echo $creator_email; ?></dc:creator>
<dc:rights>Copyright <?php echo gmdate("Y", time()); ?></dc:rights>
<admin:generatoragent rdf:resource="http://www.codeigniter.com/">
<?php foreach($posts->result() as $post): ?>
<item>
<link><?php echo site_url('blog/posting/' . $post->id) ?>
<guid><?php echo site_url('blog/posting/' . $post->id) ?></guid>
<description><!--[CDATA[ <?php echo character_limiter($post->text, 200); ?> ]]></description>
<pubdate><?php echo $post->date; ?></pubdate>
</item>
<?php endforeach; ?>
</admin:generatoragent>
</channel></rss>
Can anyone please explain why this is happening, like I said earlier it loads fine in its own codeigniter directory but loading inside my current project does this.
Any help would be asppreciated...