<script>
function updateOnlineStatus() {
    var xhr = new XMLHttpRequest();
    xhr.open("POST", "update_online_status.php", true);
    xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xhr.send();
}

// Call updateOnlineStatus every 5 minutes (300,000 milliseconds)
setInterval(updateOnlineStatus, 300000);

// Call updateOnlineStatus when the page loads
window.onload = updateOnlineStatus;
</script>
