https://api.liesys.com/ipv4-ipv6.php
源代码:
<?php
$user_IP = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
$user_IP = ($user_IP) ? $user_IP : $_SERVER["REMOTE_ADDR"];
if(!filter_var($user_IP, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$image= "images/ipv4.png";
} else {
$image= "images/ipv6.png";
}
Header("Location: $image");
?>