0

use HTTP_CLIENT_IP over REMOTE_ADDR toolbox.php

eduardotv yesterday at 11:44 a.m. 0

in toolbox.php


public static function getRemoteIpAddress()

{

if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {

$ipList = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);

return trim($ipList[0]); // Pega o primeiro IP da lista

} elseif (!empty($_SERVER['HTTP_CLIENT_IP'])) {

return $_SERVER['HTTP_CLIENT_IP'];

} else {

return $_SERVER['REMOTE_ADDR'];

}

}