This commit is contained in:
Andrew Trieu
2023-02-10 19:20:34 +02:00
parent c717c9e4c1
commit 5f98bab91e
23 changed files with 586 additions and 325 deletions

18
php/logout.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
session_start();
if (isset($_SESSION['unique_id'])) {
include_once "config.php";
$logout_id = mysqli_real_escape_string($conn, $_GET['logout_id']);
if (isset($logout_id)) {
$sql = mysqli_query($conn, "UPDATE users SET status = 'Offline' WHERE unique_id={$_GET['logout_id']}");
if ($sql) {
session_unset();
session_destroy();
header("location: ../start.php");
}
} else {
header("location: ../home.php");
}
} else {
header("location: ../start.php");
}