setInterval(function() { fetch('check_login_ajax.php') .then(response => response.json()) .then(data => { if (data.status === 'banned') { alert('Hesabınız banlandı!'); window.location.href = 'index.php?banlandi=1'; } else if (data.status === 'not_logged') { window.location.href = 'index.php'; } }) .catch(err => {}); }, 5000);