Ok, here's the specs:
Dev Server: Windows, WAMP, PHP 5+, Codeigniter
Live Server: Ubuntu Linux, PHP, CodeIgniter, LAMP
I get the following error in Firefox from my Live Server:
XML Parsing Error: junk after document element Location: http://www.mysite.com/feed/rss2/ Line Number 2, Column 1:
*syntax error, unexpected T_STRING in ...rss2.php*
HOWEVER, everything works like a beaut in Windows, in my Dev Environment.
Can anyone help me?
Here's the code:
function rss2() {
@header("Content-Type: text/xml");
$settings = $this->db_model->get_db_settings();
$data['encoding'] = 'utf-8';
$data["feed_name"] = $settings["sitename"];
$data["feed_url"] = base_url() . "feed/rss2";
$data["page_description"] = "RSS Feed for " . $settings["sitename"];
$data["page_language"] = "en-us";
$data["creator_email"] = "[email protected]";
$data["todays_date"] = date("c");
//Array?
$rssfeed = $this->blog_model->get_blog_posts_by_status("published");
$i = 0;
foreach ($rssfeed as $row) {
//feed the details into the array
$rss_data[$i]["title"] = $row["title"];
$rss_data[$i]["permalink"] = base_url() . "content/blog/" . $row["slug"];
$rss_data[$i]["date"] = $row["date"];
$rss_data[$i]["description"] = utf8_encode(html_entity_decode($row["content"], ENT_QUOTES));
$rss_data[$i]["category"] = "No Category";
$i=1;
}
if ($i == 0) {
$data["rss_data"] = NULL;
} else {
$data["rss_data"] = $rss_data;
}
$this->load->view("system/feed/rss2", $data);
}