2020
11-25
11-25
PHP获取真实IP及IP模拟方法解析
PHP获取用户真实IP方法1:<?phpfunctionGetIP(){if(!empty($_SERVER["HTTP_CLIENT_IP"])){$cip=$_SERVER["HTTP_CLIENT_IP"];}elseif(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){$cip=$_SERVER["HTTP_X_FORWARDED_FOR"];}elseif(!empty($_SERVER["REMOTE_ADDR"])){$cip=$_SERVER["REMOTE_ADDR"];}else{$cip="无法获取!";}return$cip;}echoGetIP();?>PHP获取用户真实IP方法2:<?phperror_reporting(E...
继续阅读 >