<?php
require("includes/global.php");

if ($userInfo['loggedin']) {
 mysqli_query($connection,"DELETE FROM `online` WHERE username='".$userInfo['username']."'");
 $_SESSION['forum_user'] = null;
 $_SESSION['loggedin'] = 0;
 session_unset();
}

header("Location: index.php");
exit;
?>