Hello,
I have a chat system where I need the ability to log out all users at the end of the meeting. They can do this individually, however most of them neglect to do so and it is necessary for other purposes. Below is the link they have individually to log out. How could I edit this so that I can add it on my ADMIN page, and log out ALL of the people in the "unique_id" column of the database?
<a href="php/logout.php?logout_id=<?php echo $row['unique_id']; ?>" class="logout">Logout</a>
And here is the logout page php
<?php
session_set_cookie_params(0);
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)){
$status = "Offline now";
$sql = mysqli_query($conn, "UPDATE users SET status = '{$status}' WHERE unique_id={$_GET['logout_id']}");
if($sql){
session_unset();
session_destroy();
header("location: https://www.peredy1.com/adminchat/logintool.php");
}
}else{
header("location: ../users.php");
}
}else{
header("location: https://www.peredy1.com/adminchat/logintool.php");
}
?>
Many many thanks for any help with this