代码如下:
<span style="color: #000000;">php </span><span style="color: #0000ff;">if</span>(<span style="color: #800080;">$_SERVER</span>['HTTP_CLIENT_IP'<span style="color: #000000;">]){ </span><span style="color: #800080;">$onlineip</span>=<span style="color: #800080;">$_SERVER</span>['HTTP_CLIENT_IP'<span style="color: #000000;">]; }</span><span style="color: #0000ff;">elseif</span>(<span style="color: #800080;">$_SERVER</span>['HTTP_X_FORWARDED_FOR'<span style="color: #000000;">]){ </span><span style="color: #800080;">$onlineip</span>=<span style="color: #800080;">$_SERVER</span>['HTTP_X_FORWARDED_FOR'<span style="color: #000000;">]; }</span><span style="color: #0000ff;">else</span><span style="color: #000000;">{ </span><span style="color: #800080;">$onlineip</span>=<span style="color: #800080;">$_SERVER</span>['REMOTE_ADDR'<span style="color: #000000;">]; } </span><span style="color: #008000;">/*</span><span style="color: #008000;"> 何问起 hovertree.com </span><span style="color: #008000;">*/</span> <span style="color: #0000ff;">echo</span> <span style="color: #800080;">$onlineip</span><span style="color: #000000;">; </span>?>