$ip = $_SERVER['HTTP_CLIENT_IP']?$_SERVER['HTTP_CLIENT_IP']:($_SERVER['HTTP_X_FORWARDED_FOR']?$_SERVER['HTTP_X_FORWARDED_FOR']:$_SERVER['REMOTE_ADDR']);
if(is_array($ip)){ $ip = implode(",",$ip); }
$pdo->query(insert into ips (username,ip_address) values ($username,$ip));
takıldığınız bir yer varsa srun hocam