aboutsummaryrefslogtreecommitdiff
path: root/Html/admin/logout.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Html/admin/logout.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/Html/admin/logout.php b/Html/admin/logout.php
new file mode 100644
index 0000000..dbd5586
--- /dev/null
+++ b/Html/admin/logout.php
@@ -0,0 +1,17 @@
+<?php
+//include config
+require_once('../includes/config.php');
+
+//log user out
+$user->logout();
+
+//on supprime le user de la base SQL connectes
+$stmt = $db->prepare('DELETE FROM connectes WHERE pseudo = :pseudo') ;
+$stmt->execute(array(
+ ':pseudo' => $_SESSION['username']
+));
+
+
+header('Location: login.php');
+
+?>