";
if (! empty($_POST['pseudo']) and ! empty($_POST['contenu'])) {
$pseudo = htmlentities($_POST['pseudo']);
$site = htmlentities($_POST['site']);
$contenu = text2html($_POST['contenu']);
$query = "INSERT INTO galerie (section,fichier,pseudo,site,contenu) VALUES
('".$cat."','".$file."','".$pseudo."','".$site."','".$contenu."')";
echo $query;
mysql_query($query) or die(mysql_error());
}
$query = "SELECT * FROM galerie WHERE section='$cat' and fichier='$file' ORDER BY id DESC";
$result = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) == 0) { echo "
Par ".$row{'pseudo'}.", le ".$regs[3]."/".$regs[2]."/".$regs[1]." à ".$regs[4].":".$regs[5].":".$regs[6]." ";
$contenu = explode("\n",$row{'contenu'});
foreach($contenu as $key) { print "$key \n"; }
echo "
";
}
}
echo "";
if (empty($_POST['pseudo']) or empty($_POST['contenu']))
{
echo "