This repository has been archived on 2025-12-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
chatline/php/logout.php
Andrew Trieu 5f98bab91e Finalize
2023-02-10 19:20:34 +02:00

18 lines
547 B
PHP

<?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");
}