RSS feed not showing in Chrome

Hi Guys,

I’ve built an RSS feed but it just wont work in Chrome. The BBC RSS feed works fine in Chrome so it’s not the browser. Here is a snippet of the RSS output. Am I missing anything?


<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>JobBoardScripts Search Results</title>
<description>RSS Feed for JobBoardScripts Search</description>
<link>http://www.domain.co.uk</link>
<atom:link href="http://www.domain.co.uk/rss/rss.php" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[Accounts Payable Officer ]]></title>
<description><![CDATA[
	Job title: Accounts Payable Officer

	Salary range: &pound;22- &pound;26k

	Direct reports: None

	Purpose of the role

	Reporting to the Finance Manager the purpose of this role is to provide a full purchase ledger function within a busy Finance team. The Accounts Payable Officer will also be required to manage the small Corporate sales ledgers.

	Candidate profile

	The succe...]]></description>
<link><![CDATA[http://www.domain.co.uk/company/mp-resourcing/accounts-payable-officer-3147.html]]></link>
<guid>http://www.domain.co.uk/company/mp-resourcing/accounts-payable-officer-3147.html</guid>
<pubDate>Wed, 12 Feb 2014 19:45:14 +0000</pubDate>
</item>
<item>
<title><![CDATA[Assistant Content Editor ]]></title>
<description><![CDATA[
	Job title: Assistant Content Editor

	Salary:&pound;17,000

	Reporting to: Content Editor

	Location: Wallingford

	Purpose of the role

	The purpose of this role is to assist with editorial tasks in Content Management across a variety of subject areas to ensure relevant products and websites are updated regularly and content for further processing is identified as required.

	T...]]></description>
<link><![CDATA[http://www.domain.co.uk/company/mp-resourcing/assistant-content-editor-3144.html]]></link>
<guid>http://www.domain.co.uk/company/mp-resourcing/assistant-content-editor-3144.html</guid>
<pubDate>Tue, 11 Feb 2014 18:48:15 +0000</pubDate>
</item>
<item>
<title><![CDATA[Data Correction Operator (temp-to-perm)]]></title>
<description><![CDATA[
	Data Correction Operator (temp-to-perm)

	Do you have highly accurate visual skills? Can you maintain a high level of focus in a busy environment? If you are this conscientious, meticulous and thorough person we are looking for, we would love to hear from you.

	This full-time position on an initial 2 month contract could convert to a permanent position depending on your performance (accura...]]></description>
<link><![CDATA[http://www.domain.co.uk/company/mp-resourcing/data-correction-operator-temp-to-perm--3141.html]]></link>
<guid>http://www.domain.co.uk/company/mp-resourcing/data-correction-operator-temp-to-perm--3141.html</guid>
<pubDate>Mon, 10 Feb 2014 11:22:10 +0000</pubDate>
</item>
</channel>
</rss>


Hi Zaggs,

When you say it doesn’t work in Chrome, are you getting any output at all? Or it’s displaying the feed as plain text rather than xml?

Yes it’s just displaying the plain text rather than the XML…

Try setting the content type header (note that you have to call the header() function before you output anything from your script):

header("Content-Type: application/rss+xml");

Thanks, I thought this might have solved it - but still the same :frowning:

Could you share the code you’re using to generate the output, and maybe a link to see it in action (if it’s online)?

Hmm, so after further investigation it seems that even though Chrome reports ‘application/rss+xml’ as the content type, you have to set it as ‘text/xml’ in PHP. You learn something new everyday :slight_smile:

Thanks, that worked perfectly :slight_smile: