JQuery Chat Kick/Ban
Posted: Mon Apr 15, 2013 1:08 pm
I'm wrapping my head around a kick/ban feature for a chat I'm working on. My only question, is if I were to create a simple JavaScript function like...
function check(){ $.ajax({ type: "GET", url: "check.php", data: { 'function': 'check' }, success: function(data){ // Something } }); }But actually tested... And it was called upon every second or so, to go to a php file such as...
<?php session_start(); $data = array(); switch ($function) { case ('check'): if(isset($_SESSION['banned']) && $_SESSION['banned'] == 1) $data[] = 1; else $data[] = 0; // And probably kicked here too break; } ?>But actually tested... Would this affect the server performance. I'm not too sure what the affects would be for 100-500 people, and I would like opinions before I start development.