Jump to content

PHP for RSS feeds


sotusotusotu

Recommended Posts

Hey all,

 

I just wanted to ask if anybody knows if you can use php for RSS feeds.  For example, I would like to query a db and bring some user information into my RSS feed.  I have not been able to find any examples anywhere.  I need to see if it is possible for a RSS reader to be able to accept the files and only see the XML itself?

 

Can anyone point me in the right direction please?

Link to comment
https://forums.phpfreaks.com/topic/73198-php-for-rss-feeds/
Share on other sites

Cheers mate. Looking back I didn't word the question very well.

 

I am doing a test at the moments (sorry this is all completely new to me) and using the following code:

 

<? header("Content-Type: application/xml; charset=ISO-8859-1"); ?>

<?

echo '

  <?xml version="1.0"?>

      <rss version="2.0">


      <channel>


      <title>Test</title>
      <link>bigstuff.mp3</link>
      <description>Podcast</description>
      <language>en-us</language>
      <copyright>2005</copyright>
      <lastBuildDate>Today’s Date*</lastBuildDate>
      <webMaster>[email protected]</webMaster>
      <ttl>1</ttl>
      <item>


      <title>Podcast</title>
      <description>Here is my Monday podcast. Hope you like it.</description>
      <pubDate>Sun, 14 Oct 2007 14:30:00 GMT</pubDate>*

<enclosure url="bigstuff.mp3" length="4834743" type="audio/mpeg"/>
</item>
</channel>
</rss>

';

?>

 

I am receiving the following error:

 

XML Parsing Error: xml declaration not at start of external entity
Location: http://www.stuffdevelopment.com/sc_subscribe/subscribe.php
Line Number 4, Column 4:	  <?xml version="1.0"?>
----------^

 

Any ideas? or am I going about this the wrong way.

Link to comment
https://forums.phpfreaks.com/topic/73198-php-for-rss-feeds/#findComment-369252
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.