php uses $_SERVER["REMOTE_ADDR"] to obtain the access IP address, _serverremote_addr
print "Your IP address is:";
if(!empty($_SERVER["HTTP_CLIENT_IP"])){
$cip = $_SERVER["HTTP_CLIENT_IP"];
}
elseif(!empty($_SERVER[" HTTP_X_FORWARDED_FOR"])){
$cip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}
elseif(!empty($_SERVER["REMOTE_ADDR"])){
$cip = $_SERVER ["REMOTE_ADDR"];
}
else{
$cip = "Unable to obtain!";
}
print $cip;
http://www.bkjia.com/PHPjc/988861.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/988861.htmlTechArticlephp uses $_SERVER[REMOTE_ADDR] to obtain the access IP address, _serverremote_addr print "Your IP address is:"; if (!empty($_SERVER["HTTP_CLIENT_IP"])){ $cip = $_SERVER["HTTP_CLIENT_IP"]; } e...