--- fenglin/lib/client_addr.inc.php 2004/06/27 00:39:39 1.5 +++ fenglin/lib/client_addr.inc.php 2005/03/12 08:29:35 1.7 @@ -10,12 +10,12 @@ function Client_Address($addr=null,$x_ad if ($addr == null) $addr = $_SERVER["REMOTE_ADDR"]; - if ($x_addr == null && isset($_SERVER["HTTP_X_CLIENT_ADDR"])) - $x_addr = $_SERVER["HTTP_X_CLIENT_ADDR"]; + if ($x_addr == null && isset($_SERVER["HTTP_X_FORWARDED_FOR"])) + $x_addr = $_SERVER["HTTP_X_FORWARDED_FOR"]; foreach($proxy_ip as $ip) { - if (ereg($ip,$addr)) + if (ereg($ip[0],$addr)) { if ($x_addr != null) { @@ -25,7 +25,7 @@ function Client_Address($addr=null,$x_ad $proxy = false; foreach($proxy_ip as $ip) { - if (ereg($ip,$client_addr[$i])) + if (ereg($ip[0],$client_addr[$i])) $proxy = true; } if (!$proxy)