PHP gets the client IP address example

zhaozj2021-02-12  144

UNSET ($ onlineIP);

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'];

Echo $ onlineIP;

?>

转载请注明原文地址:https://www.9cbs.com/read-6712.html

New Post(0)