stavo provando a creare un rss per il mio blog e l'ho codato nel seguente modo, seguendo un mezzo tutorial
- Codice: Seleziona tutto
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Giovanni Santostefano weblog</title>
<link>http://polystream.altervista.org</link>
<description>rss per essere aggiornati sui miei post</description>
<language>it</language>
<?php
// Get the PHP file containing the DbConnector class
require_once('block/db.php');
require_once('block/System.php');
$settings = System::getSettings();
$ptop=160;
// Create an instance of DbConnector
$connector = new DB();
// Use the query function of DbConnector to run a database query
// (The arrow -> is used to access a function of an object)
$result = $connector->query('SELECT * FROM post ORDER BY id DESC');
// Get the result
//$row = $connector->fetchArray($result);
//echo $row['titolo'];
while ($row = $connector->fetchArray($result)){
echo '<item>';
echo '<title>'.$row['titolo'].'</title>';
echo '<pubDate>'.$row['data'].'</pubDate>';
echo '<link>'.$settings['site'].'read.php?idm='.$row['id'].'</link>';
if(strlen($row['testo'])>200){
$testo=substr($row['testo'],0,200);
echo '<description>'.$testo.'</descritpion>';
}
else
{
echo '<description>'.$row['testo'].'</descritpion>';
}
echo '</item>';
}
?>
</channel>
</rss>
Quando carico la pagina ottengo il seguente errore
- Codice: Seleziona tutto
Parse error: syntax error, unexpected T_STRING in /membri2/polystream/rss.php on line 1
Google non mi è stato d'aiuto... se avete una minima idea del perchè esplode in quel modo vi prego di spiegarmela.
Grazie
Gio


è per il <?
) e altre cose ancora non muovo il c**** ad effettuare le modifiche. Ci proverò in serata spero.