Answers for "$check ip=$_SERVER['REMOTE_ADDR']; if (isset($_SERVER['HTTP_X_REAL_IP']) && '10.2.'==substr($check_ip,0,5)) { $check_ip=$_SERVER['HTTP_X_REAL_IP']; }"

PHP
4

php get user ip

$ip = $_SERVER['REMOTE_ADDR'];
Posted by: Guest on July-05-2019
0

php get user ip address

#to best handle proxies use this:
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
    $ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
    $ip = $_SERVER['REMOTE_ADDR'];
}
Posted by: Guest on October-16-2020

Code answers related to "$check ip=$_SERVER['REMOTE_ADDR']; if (isset($_SERVER['HTTP_X_REAL_IP']) && '10.2.'==substr($check_ip,0,5)) { $check_ip=$_SERVER['HTTP_X_REAL_IP']; }"

Browse Popular Code Answers by Language