function user_realip() { if (getenv(‘HTTP_CLIENT_IP‘)) { $ip = getenv(‘HTTP_CLIENT_IP‘); } elseif (getenv(‘HTTP_X_FORWARDED_FOR‘)) { $ip = getenv(‘HTTP_X_FORWARDED_FOR‘); } elseif (getenv(‘REMOTE_ADDR‘)) { $ip = getenv(‘REMOTE_ADDR‘); } else { $ip = $HTTP_SERVER_VARS[‘REMOTE_ADDR‘]; } return $ip; }
时间: 2024-10-27 12:29:43