$chemin[3] = preg_replace("/^(\d+).*/","$1",$chemin[3]); $date=date(Y)."-".date(m)."-".date(d)." ".date(H).":".date(i).":".date(s); if (empty($axx)) { echo "
Vous devez etre identifies pour poster un nouvel element
\n"; } else { $nom = $_POST['nom'] or $nom = ""; $contenu = $_POST['contenu'] or $contenu = ""; $action = $_POST['action'] or $action = ""; if (empty($nom) or empty($contenu) or empty($nick)) { echo "Nouvel element: $chemin[2]
"; aide(); echo " "; } else { if ($action == "Accepter") { $query = "SELECT MAX(topic_id) from $chemin[2]"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $topic_id = $row[0]+1; } echo "Ajout du topic: $topic_id
";
$query = "INSERT INTO $chemin[2] (topic_id,com_id,nom,pseudo,date,contenu) VALUES('$topic_id','1','$nom','$nick','$date','".text2html($contenu)."')";
mysql_query($query) or die(mysql_error()."
$query");
echo "
Retour :: Visualier"; } elseif($action=="Visualiser") { aide(); $date = preg_replace("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/","$3/$2/$1 à $4:$5:$6",$date); echo "
Nouvel element: $chemin[2]
"; echo "$key
\n"; } echo "