Need a bit of advice. I found a RSS script and modified it for my own purposes.
I am pulling the information from the database. Everything works fine. I can pull the title, and description and the rss feed works and is displayed correctly on screen.
However my problem occurs when I need to add the link in the <link></link> tags.
If I enter a url in the <link></link> tags, and try to display the rss page again, I just end up getting a blank page.
I presume this is to do with the characters in the http:// part of the address?
Wondering if you have any solution or shed some light on this?
The script I am using is below.
<?php
//SET XML HEADER
header('Content-type: text/xml');
//CONSTRUCT RSS FEED HEADERS
$output = '<rss version="2.0">';
$output .= '<channel>';
$output .= '<title>RSS Feed</title>';
$output .= '<description></description>';
$output .= '<link></link>';
include('db_settings.php');
$dbcnx = @mysql_connect("$servername","$username", "$password");
if (!$dbcnx)
{ echo( "" );
exit(); }
// Connect to database
if (! @mysql_select_db("$database") ) { echo( "<P>Unable to locate the database" . "" );
exit();
}
// Request results from tables
$result = mysql_query("SELECT * FROM articles ORDER BY date_posted");
while ( $row = mysql_fetch_array($result) )
{
//BODY OF RSS FEED
$output .= '<item>';
$output .= '<title>'. $row['title'] .'</title>';
$output .= '<description>'. $row['meta_description'] .'</description>';
$output .= '<link>{Problem Occurs Here when I enter URL}</link>';
$output .= '<pubDate>Date Published</pubDate>';
$output .= '</item> ';
}
//CLOSE RSS FEED
$output .= '</channel>';
$output .= '</rss>';
//SEND COMPLETE RSS FEED TO BROWSER
echo($output);
?>