Thanks
Code: Select all
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
Code: Select all
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
Code: Select all
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$remoteAddr = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$remoteAddr = $_SERVER['REMOTE_ADDR'];
}
Code: Select all
$remoteAddr = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'] ?? null;