Welcome Guest, Not a member yet? Register   Sign In
My RSS feed is being interpreted as download?
#1

[eluser]taewoo[/eluser]
Hi all.

I followed Derek's tutorial on how to create RSS feed with CI. With my feed, i try to load it in the browser, the browser asks me to download.. Is this a header issue? (By the way... browser screenshot attached)

Controller:
Code:
$data['encoding'] = 'utf-8';        
$data['feed_name'] = 'RedMol.com';        
$data['feed_url'] = site_url();        
$data['page_description'] = 'Real Estate Cashflow Investments';        
$data['page_language'] = 'en-us';        
$data['creator_email'] = '[email protected]';        
$data['entries'] = $this->blog_model->get_any_blogs();          
header("Content-Type: application/rss+xml");        
$this->load->view('feed/rss', $data);

View
Code:
<?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
<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>        
    
        &lt;title&gt;&lt;?= $feed_name; ?&gt;&lt;/title&gt;    
        &lt;link&gt;&lt;?= $feed_url; ?&gt;&lt;/link&gt;    
        <description>&lt;?= $page_description; ?&gt;</description>    
        <dc:language>&lt;?= $page_language; ?&gt;</dc:language>    
        <dc:creator>&lt;?= $creator_email; ?&gt;</dc:creator>    
        <dc:rights>Copyright &lt;?= gmdate("Y", time()); ?&gt;</dc:rights>
        &lt;?php foreach($entries as $entry){ ?&gt;            
            <item>          
                &lt;title&gt;&lt;?= xml_convert($entry->title); ?&gt;&lt;/title&gt;          
                &lt;link&gt;&lt;?= site_url('blog/user/'.$entry->user_name.'/'.date("Y/m/d/", $entry->created).url_title($entry->title) . $entry->title) ?&gt;&lt;/link&gt;          
                <guid>&lt;?= site_url('blog/user/'.$entry->user_name.'/'.date("Y/m/d/", $entry->created).url_title($entry->title) . $entry->title) ?&gt;</guid>          
                <pubDate>&lt;?= date ('r', $entry->created);?&gt;</pubDate>        
            </item>            
        &lt;?php } ?&gt;        
    </channel>
</rss>


Messages In This Thread
My RSS feed is being interpreted as download? - by El Forum - 05-01-2008, 06:08 PM
My RSS feed is being interpreted as download? - by El Forum - 05-02-2008, 01:10 AM
My RSS feed is being interpreted as download? - by El Forum - 05-04-2008, 11:44 AM
My RSS feed is being interpreted as download? - by El Forum - 05-15-2008, 03:35 PM
My RSS feed is being interpreted as download? - by El Forum - 08-08-2008, 05:03 AM
My RSS feed is being interpreted as download? - by El Forum - 08-08-2008, 11:09 AM
My RSS feed is being interpreted as download? - by El Forum - 08-08-2008, 01:45 PM
My RSS feed is being interpreted as download? - by El Forum - 08-08-2008, 01:48 PM
My RSS feed is being interpreted as download? - by El Forum - 08-09-2008, 05:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB