I have wrote a code to generate rss feed by a php script
It works fine on localhost, but when uploaded to the server, it sends this error:
Parse error: syntax error, unexpected T_STRING in /path_to_directory/rss_feed.php on line 12
As you see line 12 is:
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" ?>Code: Select all
<?php
session_start();
require("dbconnect.php");
if(!isset($_SESSION['usertype']))
{
header("Location: login.php");
}
else
{
header("Content-Type: application/xml; charset=ISO-8859-1");
?>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>page title</title>
<link>page link</link>
<?php
$result=mysql_query("SELECT * FROM feed ORDER BY id DESC LIMIT 20 ");
while($row=mysql_fetch_array($result)){
//there are some more code here
$item="<item>
<title>$title</title>
<link>$link</link>
<description>$desc</description>
</item>";
echo $item;
}
}
?>
</channel>
</rss>