no, non l'ho fatto io ho trvato questi due file, e mi sa che c'entri anche tu
Codice PHP:
<?php
if(strlen($_POST['commento'])<1)
die('Non hai immesso alcun testo!');
$commento = $_POST['commento'];
$commento = substr('<','<',$commento);
$commento = substr('>','>',$commento);
$commento = substr('è','è',$commento);
$data_ora = date('Y/m/d');
$db = mysql_connect("localhost", "root","");
if(!$db)
die('ERRORE: non posso accedere al database!');
mysql_select_db("my_squadranostra",$db);
$testo="INSERT INTO commenti (commento,data_ora) VALUES ('$commento','$data_ora')";
if(!mysql_query($testo,$db))
die('Errore: non riesco a eseguire la query');
mysql_close($db);
?>
Codice PHP:
<?php
$contatore = 0;
$db = mysql_connect("localhost", "root","");
if(!$db)
die('ERRORE: non posso accedere al database!');
mysql_select_db("my_squadranostra",$db);
$testo="SELECT * FROM commenti WHERE 1";
if(!$query = mysql_query($testo,$db))
die('Errore: non riesco a eseguire la query');
echo "<html><head><title>Pagina di commenti</title></head><body>";
while($array = mysql_fetch_array($query))
{
echo "<strong>Commento</strong>del ".$array['data_ora'].":<font color='red'>\n".$array['commento']."</font><br>";
}
echo "<br></body></html>";
mysql_close($db);
?>
<br><br><center><font color="red"><a href="index.html">Torna in Home</a></font></center>