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">
<title>JobBoardScripts Search Results</title>
<description>RSS Feed for JobBoardScripts Search</description>
<atom:link href="http://www.domain.co.uk/rss/rss.php" rel="self" type="application/rss+xml" />
<title><![CDATA[Accounts Payable Officer ]]></title>
Job title: Accounts Payable Officer
Salary range: £22- £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.
<pubDate>Wed, 12 Feb 2014 19:45:14 +0000</pubDate>
<title><![CDATA[Assistant Content Editor ]]></title>
Job title: Assistant Content Editor
Reporting to: Content Editor
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.
<pubDate>Tue, 11 Feb 2014 18:48:15 +0000</pubDate>
<title><![CDATA[Data Correction Operator (temp-to-perm)]]></title>
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>
<pubDate>Mon, 10 Feb 2014 11:22:10 +0000</pubDate>
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):
Thanks, I thought this might have solved it - but still the same
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
Thanks, that worked perfectly
This topic is now closed. New replies are no longer allowed.