<?
include ('logue.php');
include ('entete2.php');

$id = $_POST["id"];

$sql5 = "SELECT * FROM matgraph_msg WHERE id = $id";
$res5 = db_mysql_Query($sql5)or die('erreur sql<br>'.$sql5.'<br>'.mysql_error());
$row5 = mysql_fetch_array($res5);


$sql4 = "INSERT INTO `matgraph_msg_log` ( `id` , `date` , `lu` , `receveur` , `sujet` , `msg` )
VALUES (
'$row5[id]', '$row5[date]', '$row5[lu]', '$row5[receveur]', '".addslashes($row5[sujet])."', '".addslashes($row5[msg])."'
)";

$res4 = db_mysql_Query($sql4)or die('erreur sql<br>'.$sql4.'<br>'.mysql_error());

$sql4 = "DELETE FROM matgraph_msg WHERE id = $id";
$res4 = db_mysql_Query($sql4)or die('erreur sql<br>'.$sql4.'<br>'.mysql_error());
echo '<script language="javascript" type="text/javascript">
<!--
window.location.replace("mp_lire_msg.php");
-->
</script>';

?>