Hi everybody
Can you anyone please help me with my problem. I am trying generate an implement an RSS Feed on one of the sites I am working on. The problem is when the user clicks on the RSS icon, firefox picks up the feed and ask the user to subscribe. but then after the user has subscribed or cancel, the page does not go back to the previous page, thus display a blank page. In Internet Explorer, it works fine. Here's the code below, I got it from the net, I just did some minor changes to fit my needs
<?php
/*
header("Content-Type: application/xml; charset=ISO-8859-1");
include("RSS.class.php");
$rss = new RSS();
echo $rss->GetFeed(); */
$baseurl= LOCAL_ROOT_PATH."index.php?c=about";
$i=0;
$rss="";
$rss.="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
$rss.="<rss version=\"0.91\">\n";
$rss.="<channel>\n";
$rss.="\t<title>Fleet Headlines</title>\n";
$rss.="\t<description> At Fleet.com, we believe in providing a unique model of innovative,
creative and high-quality products and services, enabling customers to utilize to the fullest
potential their operational resources and assets, thus giving them a competitive advantage.
</description>\n";
$rss.="\t<link>http://10.0.3.25/projects/fleet2/index.php?c=about</link>\n";
require('inc.init.php');
require('cfg/inc.config.php');
require('core/inc.strip_all.php');
require_once('core/func.mysqlPrepare.php');
require_once('core/func.getSqlOptions.php');
require_once('core/func.nvl.php');
$nextPage = $_SERVER['HTTP_REFERER'];
$query="SELECT id, summary, CONCAT('index.php?c=news-details&id=','',id) AS url, title, news_text,
DATE_FORMAT(news_date, '%d/%m/%Y') news_date
FROM news
ORDER BY news_date DESC
LIMIT 10";
if ($result=mysql_query($query,$connection)){
while($dataobject=mysql_fetch_object($result)){
$subject=stripslashes($dataobject->title);
$url=stripslashes($dataobject->url);
$publishdate=stripslashes($dataobject->news_date);
$content=stripslashes($dataobject->summary);
$rss.="<item>\n";
$rss.="\t<title><![CDATA[$subject]]></title>\n";
$rss.="\t<pubDate>$publishdate</pubDate>\n";
$rss.="\t<link>http://10.0.3.25/projects/fleet2/".$url."</link>\n";
$rss.="\t<description><![CDATA[".$content."]]></description>\n";
$rss.="</item>\n";
$i++;
}
}else {
echo "$query: ".mysql_error();
}
$rss.="</channel>\n";
$rss.="</rss>\n";
if(file_exists(LOCAL_ROOT_PATH."rss.xml")){
unlink(LOCAL_ROOT_PATH."rss.xml");
}
if(file_exists(LOCAL_ROOT_PATH."rss.xml")){
$handle=fopen(LOCAL_ROOT_PATH."rss.xml","w") or die("cannot open rss.xml");
} else {
$handle=fopen(LOCAL_ROOT_PATH."rss.xml","w") or die("cannot open rss.xml");
if(fwrite($handle,$rss,strlen($rss))){
fclose($handle);
}
}
?>
<script language="javascript" type="text/javascript">
window.location = "rss.xml";
</script>