|
在需要的位置放以下代码
{dede:php}
$user_IP = ($_SERVER["HTTP_VIA",) ? $_SERVER["HTTP_X_FORWARDED_FOR", : $_SERVER["REMOTE_ADDR",;
$user_IP = ($user_IP) ? $user_IP : $_SERVER["REMOTE_ADDR",;
function get_real_ip(){
$ip=false;
if(!emptyempty($_SERVER["HTTP_CLIENT_IP",)){
$ip = $_SERVER["HTTP_CLIENT_IP",;
}
if (!emptyempty($_SERVER['HTTP_X_FORWARDED_FOR',)) {
$ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR',);
if ($ip) { array_unshift($ips, $ip); $ip = FALSE; }
for ($i = 0; $i |
|