get the ip of user
-
Hi,
WP 5.4 php 7.3My hosting service uses this script on the server:
if ( isset( $_SERVER[ “HTTP_X_FORWARDED_FOR” ] ) ) {
$_SERVER[ ‘REMOTE_ADDR’ ] = $_SERVER[ “HTTP_X_FORWARDED_FOR” ];
}
if ($_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’) {
$_SERVER[‘HTTPS’]=’on’;
# $_SERVER[ ‘REMOTE_ADDR’ ] = $_SERVER[ “HTTP_X_REAL_FOR” ];
$_SERVER[ ‘REMOTE_ADDR’ ] = $_SERVER[ “HTTP_X_REAL_IP” ];
}But if I use global options “Use the X-Real-IP HTTP header” the IP does not return anything, if instead I use global options “Use the X-Forwarded-For HTTP header” the returned IP is local 127.0.0.1
what should I do
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get the ip of user’ is closed to new replies.