相关问题
- HTTP request over IPv6
- dual-stack ipv6/ipv4 on localhost
- IPV6 Swift Reachability
- Regular expression to validate InetSocketAddresses
- Best way to store an IPv6 in UNKNOWN DB?
相关文章
- RewriteRule with an IPv6 IP address does not work
- Convert from MAC to IPv6
- How to convert IPv4-mapped-IPv6 address to IPv4 (s
- How do I access the web server or website using li
- Link-scope IPv6 Multicast packets suddenly not rou
- Java Library for converting a long IPv6 address in
- Rails IPv6 server
- Can't reproduce (IPv6?) connection issue that
if (isset($_SERVER)){
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])){
$realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} else if (isset($_SERVER["HTTP_CLIENT_IP"])) {
$realip = $_SERVER["HTTP_CLIENT_IP"];
} else {
$realip = $_SERVER["REMOTE_ADDR"];
}
} else {
if (getenv("HTTP_X_FORWARDED_FOR")){
$realip = getenv("HTTP_X_FORWARDED_FOR");
} else if (getenv("HTTP_CLIENT_IP")) {
$realip = getenv("HTTP_CLIENT_IP");
} else {
$realip = getenv("REMOTE_ADDR");
}
}
return $realip;