<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_25657"> <div class="blockcode"> <div id="code_pfS"><ol> <li> <li><?php<li>/*<li> func: get_client_ip()<li> 获取客户端IP地址<li>*/<li>function get_client_ip()<li>{<li> $ip=false;<li> if(!empty($_SERVER["HTTP_CLIENT_IP"]))<li> {<li> $ip = $_SERVER["HTTP_CLIENT_IP"];<li> }<li> if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))<li> {<li> $ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']);<li> if ($ip)<li> {<li> array_unshift($ips, $ip); $ip = FALSE;<li> }<li> for ($i = 0; $i < count($ips); $i )<li> {<li> if (!eregi ("^(10|172.16|192.168).", $ips[$i]))<li> {<li> $ip = $ips[$i];<li> break;<li> }<li> }<li> }<li> return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);<li>}<li>?></li> </ol></div> <em onclick="copycode($('code_pfS'));">复制代码</em> </div> </td></tr></table> <div id="comment_25657" class="cm"> </div> <div id="post_rate_div_25657"></div> <br><br>