Avrei gentilmente bisogno del vostro aiuto.
Cosa è che non va in questo script per generare rss del proprio sito?
codice:
<?php
$host = "****"; // host name
$user = "*****"; // database user name
$pass = "*****"; // database password
$database = "*****"; // database name
// connecting to database
$connect = @mysql_connect($host,$user,$pass)or die (@mysql_error());
// selecting database
@mysql_select_db($database,$connect) or die (@mysql_error());

header("Content-Type: text/xml;charset=iso-8859-1");
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<link>http://www.yourwebsite.com</link>
<language>en-us</language>
<copyright>Copyright (C) 2011 yourwebsite.com</copyright>
<pubDate>' . date("D, d M Y H:i:s O", time()) . '</pubDate>';

// selecting data from "mytable"
// mytable = your article table name
$query = @mysql_query("SELECT * FROM news ORDER BY titolo DESC LIMIT 0,10");
while($row = @mysql_fetch_array($query)){
// [url] = change it to your article title
$title = $row['titolo'];
// [url] = change it to your article title
$description = $row['desc'];
// [url] = change it to your article url
$url = $row['url'];
// [time] = change it to your article date
$date = date("D, d M Y H:i:s O", $row['data']);

echo '<item>';
echo '<title>' . $title . '</title>';
echo '<description><![CDATA[ ' . $description . ' ]]></description>';
echo '<link>' . $link . '</link>';
echo '<guid>' . $link . '</guid>';
echo '<pubDate>' . $date . '</pubDate>';
echo '</item>';
}
echo '</urlset>';

?>
L'errore che genera in explorer è il seguente:

Dichiarazione XML non valida.
Riga: 2 Carattere: 3

<?xml version="1.0" encoding="ISO-8859-1" ?>


In firefox:

Errore interpretazione XML: la dichiarazione XML o testuale non è all'inizio di un'entità
Linea numero 2, colonna 1:
<?xml version="1.0" encoding="ISO-8859-1" ?>
^

Ringrazio anticipatamente!!