function getip(){ if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ $online_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; }elseif(isset($_SERVER['HTTP_CLIENT_IP'])){ $online_ip = $_SERVER['HTTP_CLIENT_IP']; }else{ $online_ip = $_SERVER['REMOTE_ADDR']; } return $online_ip; }