diff options
author | citizenz7 <citizenz7@protonmail.com> | 2017-04-20 18:50:55 +0200 |
---|---|---|
committer | citizenz7 <citizenz7@protonmail.com> | 2017-04-20 18:50:55 +0200 |
commit | 5fd9fa480f302902328b81f912dd67ce378284f8 (patch) | |
tree | 66234843ae2857fda12442e4f7577c527d48977c /Html/messages_supprimer.php | |
parent | ebe731862c7c741171138b1083906f391fc35aff (diff) | |
download | freetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.tar.xz freetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.zip |
V.1.4.6
Diffstat (limited to 'Html/messages_supprimer.php')
-rw-r--r-- | Html/messages_supprimer.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Html/messages_supprimer.php b/Html/messages_supprimer.php new file mode 100644 index 0000000..b35b935 --- /dev/null +++ b/Html/messages_supprimer.php @@ -0,0 +1,23 @@ +<?php +require_once('includes/config.php'); + +if(!$user->is_logged_in()) { + header('Location: login.php'); +} + +// on teste si l'id du message a bien été fourni en argument au script messages_envoyer.php +if (!isset($_GET['id_message']) || empty($_GET['id_message'])) { + header('Location: '.SITEURL.'/admin/messagerie.php?membre='.html($_SESSION['username'])); + exit(); +} +else { + $stmt = $db->prepare('DELETE FROM blog_messages WHERE messages_id = :messages_id AND messages_id_destinataire = :messages_id_destinataire'); + $stmt->execute(array( + ':messages_id' => html($_GET['id_message']), + ':messages_id_destinataire' => html($_SESSION['userid']) + )); + + header('Location: '.SITEURL.'/admin/messagerie.php?membre='.html($_SESSION['username']).'&action=messupprime'); + exit(); +} +?> |