grazie x la risposta, ora il messaggio ke mi ha view.php (dopo aver corretto) è
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\programmi\easyphp1-8\www\mia_dir\view.php on line 10
e ovviamente la riga 10 è sempre:
codice:
$query = "SELECT titolo,testo,data,autore,mail FROM news WHERE id=$_GET['id']";
per quanto riguarda il file all.php:
codice:
<html>
<head>
<title> Tutti i messaggi</title>
</head>
<body>
<?php
include("config.inc.php")
$db = mysql_connect($db_host,$db_user,$db_password);
if($db == FALSE)
die("Errore nella connessione al database, verificare i parametri nel file config.inc.php");
mysql_select_db($db_name,$db)
or die("Errore nella selezione del database. Verificare i parametri nel file config.inc.php");
if(!isset($start)OR $start<0)
$start=0;
$step=20;
$query = "SELECT id,data,titolo FROM news ORDER BY data DESC LIMIT $start,$step";
$result = mysql_query($query,$db);
while ($row = mysql_fetch_array($result))
{echo "" .date("j/n/y";$row[data]). "-$row[titolo]
";}
?>
<table width=90% border=0><tr>
<td width=20% align=left>
<?
if ($start=0)
{ $start_back = $start - $ step;
echo("<a href=all.php?start=$start_back>precedenti</a>";
}
?>
</td>
<?
$query = "SELECT count(*) AS tot FROM news";
$result = mysql_query($query,$db);
$row = mysql_fetch_array($result);
$pages = intval(($row['tot']-1)/$step)+1;
?>
<td width=60% align=center>
<?
for ($i=0; $i<$pages AND $i<20; $i++)
{ $start_page = $i*$step;
echo"<a href=all.php?start=$start_page>" .($i+1)."</a>";
}
?>
</td>
<td width=20%>
<?
if($start + $step < $row['tot'])
{$start_next = $start + $step;
echo"<a href=all.php?start=$start_next>successivi</a>";
}
?>
</td>
</tr></table>
</body>
</html>