Closed heliobentzen closed 6 years ago
How is the IP being passed in the header? Most uses HTTP_X_FORWARDED_FOR if not REMOTE_IP
Upload this file https://gist.github.com/lesterchan/890b6a1d0b7e33d761b7 to your server, see if it does get the IP.
I'm looking now this function:
if(!function_exists('get_ipaddress')) { function get_ipaddress() { if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) { $ip_address = $_SERVER["REMOTE_ADDR"]; } } else { $ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"]; } if(strpos($ip_address, ',') !== false) { $ip_address = explode(',', $ip_address); $ip_address = $ip_address[0]; } return esc_attr($ip_address); } }
I tried use HTTP_X_REAL_IP instead REMOTE_ADDR, but get it empty.
It's not possilbe get an IP using nxging as webserver. IP displayed is the same IP from host.