Jump to content

Recommended Posts

Hi,

I'm having problems with this php driven rss feed.

So far it loads the page title and description but the actual links in the feed don't show up; as seen here: http://eslassembly.com/test-feed.php

 

Can anyone see whats wrong in this code?

<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
// Set RSS version.
echo "
<rss version=\"2.0\"> ";
// Start the XML.
echo "
<channel>
<title>ESL Assembly.com | Recent Job Openings</title>
<description>Follow the list of our most recent job posts for teaching English as a second language.</description>
<link>http://www.eslassembly.com/</link>";
// Create a connection to your database.
require("php/Load.php");
if (!mysql_connect($db_host, $db_user, $db_pwd))
    die("Can't connect to database");

if (!mysql_select_db($database))
    die("Can't select database");
// Query database and select the last 10 entries.
$data = mysql_query("SELECT * FROM $table ORDER BY submission_id DESC LIMIT 10");
while($row = mysql_fetch_array($data))
{
// Continue with the 10 items to be included in the <item> section of the XML.
echo "
<item>
<link>http://www.eslassembly.com/jobsDisplay.php?id=".$row[sub_id]."</link>
<guid isPermaLink=\"false\">http://www.eslassembly.com/jobsDisplay.php?id=".$row[sub_id]."</guid>
<title>".$row[col_A]."</title>
<description><![CDATA[".substr($row[col_B],0,450)."]]></description>
</item>";
}
echo "
</channel>
</rss>";
?>

Link to comment
https://forums.phpfreaks.com/topic/143904-solved-dynamic-rss-feed-problem/
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.