prepare('INSERT INTO blog_messages (messages_id_expediteur,messages_id_destinataire,messages_date,messages_titre,messages_message) VALUES (:messages_id_expediteur,:messages_id_destinataire,:messages_date,:messages_titre,:messages_message)');
$stmt->execute(array(
':messages_id_expediteur' => html($_SESSION['userid']),
':messages_id_destinataire' => html($_POST['id_destinataire']),
':messages_date' => date("Y-m-d H:i:s"),
':messages_titre' => html($_POST['titre']),
':messages_message' => html($_POST['message'])
));
header('Location: '.SITEURL.'/admin/profil.php?membre='.html($_SESSION['username']).'&message=ok');
//$stmt->closeCursor();
//exit();
}
}
//S'il y a des erreurs, on les affiche
if(isset($error)){
foreach($error as $error){
echo '
ERREUR : '.$error.'
';
}
}
?>
prepare('SELECT * FROM blog_messages LEFT JOIN blog_members ON blog_members.memberID = blog_messages.messages_id_expediteur WHERE messages_id = :message_id');
$desti->execute(array(
':message_id' => html($_GET['id_message'])
));
$data = $desti->fetch();
?>