php 获取当前用户的IP
程序员文章站
2022-05-24 10:25:59
...
代码如下:
php if($_SERVER['HTTP_CLIENT_IP']){ $onlineip=$_SERVER['HTTP_CLIENT_IP']; }elseif($_SERVER['HTTP_X_FORWARDED_FOR']){ $onlineip=$_SERVER['HTTP_X_FORWARDED_FOR']; }else{ $onlineip=$_SERVER['REMOTE_ADDR']; } /* 何问起 hovertree.com */ echo $onlineip; ?>
上一篇: MySQL之多表操作