$action = $_POST["action"] or $action="";
$nom = $_POST["nom"];
$contenu = $_POST["contenu"];
$chemin[4] = preg_replace("[^0-9]","",$chemin[4]);
if (!$axx) {die("Not logged") ; }
$query = "SELECT pseudo,nom,contenu FROM forum_$chemin[2] WHERE topic_id='$chemin[3]' and com_id='$chemin[4]'";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
if ($nick != $row["pseudo"] and $axx < 5) { die("Non autorise"); }
if (($chemin[5] == "Supprimer" or $chemin[5] == "Editer")and $action == "Supprimer")
{
$query2 = "DELETE FROM forum_$chemin[2] WHERE topic_id='$chemin[3]' and com_id='$chemin[4]' LIMIT 1";
$result2 = mysql_query($query2) or die("$query2
".mysql_error());
echo "
Message Supprime avec Succes
"; } elseif ($chemin[5] == "Editer" and $action == "Editer" and !empty($nom) and !empty($contenu)) { $query2 = "UPDATE forum_$chemin[2] SET nom='".text2html($nom)."',contenu='".text2html($contenu)."' WHERE topic_id='$chemin[3]' and com_id='$chemin[4]' LIMIT 1 "; $result2 = mysql_query($query2) or die("$query2Message Edite avec succes!
"; } elseif($chemin[5] == "Supprimer") { echo "VOULEZ VOUS VRAIMENT SUPPRIMER CE MESSAGE?
"; echo " "; } else { aide(); echo " "; } } ?>