function RemoveIp($ip) { if (IpInConnections($ip) === true) { $sql = sprintf("DELETE FROM Connections WHERE IpKey = '%s';", $ip); return RunSql($sql); } }
<?php include 'functions.php'; $ip = $_SERVER['REMOTE_ADDR']; /*ip address of user */ $message = ""; /*message to be returned*/ /*Check if ip already associated with player in connections table*/ if (IpInConnections($ip) === true) { $message = '{"SIGNEDIN" : "SIGNEDIN"}'; } else { //the ip does not exist in connections $message = '{"SIGNEDIN" : "NOTSIGNEDIN"}'; } echo $message;