Jump to content

can not get RSS feed to generate


jasonc

Recommended Posts

I have tried sitemap.org and a few others but have not found anything that will give the results I am after.

 

I have a blog site that has a URL and a Description for the URL and wish to have the description show as the anchor text which is linked to the URL, all data is taken from MySQL.

 

Does anyone have a code that will generate something like this ?

Link to comment
Share on other sites

ok I have found a RSS feed code and added it to my file, it work stand alone in an .XML file but how do I get the data from MySQL in to it.  When I add .XML to my .htaccess file

 

AddType application/x-httpd-php5 .php .htm .html .xml

 

the page fails with an error

 

Parse error: syntax error, unexpected T_STRING on line 1

 

<?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Your title goes here</title>
        <description>Your RSS feed description goes here</description>
        <link>http://www.rssFeedFolder.com/</link>
        <language>en</language>
        <copyright>rssFeedFolder.com</copyright>
        <pubDate>Fri, 07 Dec 2007 21:58:26 CST</pubDate>
        <lastBuildDate>Fri, 07 Dec 2007 21:58:26 CST</lastBuildDate>
        <generator>rssFeedFolder.com</generator>
        <ttl>30</ttl>
        <atom:link href="http://www.yourdomain.com/yourfeed.xml" rel="self" type="application/rss+xml" />
        <image>
          <title>Your title goes here</title>
          <url>http://www.rssFeedFolder.com/images/rssFeedFolderLogo.gif</url>
          <link>http://www.rssFeedFolder.com/</link>
          <description>your RSS feed description goes here</description>
        </image>
        <item>
          <title>Your first feed file goes here</title>
          <description>A brief description of the file goes here</description>
          <link>http://www.yourdomain.com/rssfeedfolder/file1.html</link>
          <guid isPermaLink="true">http://www.yourdomain.com/rssfeedfolder/file1.html</guid>
          <pubDate>Tue, 04 Dec 2007 09:19:42 CST</pubDate>
          <source url="http://www.rssFeedFolder.com/">rssFeedFolder.com</source>
        </item>
        <item>
          <title>Your second feed file goes here</title>
          <description>A brief description of the file goes here</description>
          <link>http://www.yourdomain.com/rssfeedfolder/file2.html</link>
          <guid isPermaLink="true">http://www.yourdomain.com/rssfeedfolder/file1.html</guid>
          <pubDate>Web, 05 Dec 2007 10:23:10 CST</pubDate>
          <source url="http://www.rssFeedFolder.com/">rssFeedFolder.com</source>
        </item>
      </channel>
    </rss>

 

Link to comment
Share on other sites

Parse error: syntax error, unexpected T_STRING on line 1

 

That's because your php installation has lazy-way short open tags turned ON.

 

This is the main reason why short open tags have been turned off by default for a while now. The php parser is not smart enough to distinguish the opening <?xml tag from a short opening php tag and the only way to output xml from php code when short open tags are enabled is to echo the opening xml tag.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.