首页 > 编程知识 正文

java获取服务器ip和端口号,php限制ip段

时间:2023-05-04 22:00:54 阅读:15776 作者:116

howdoigetthegjdxlzandportofaclientwithphp?

itriedthescriptbelowbutitonlygivesmethegjdxlzaddress。

解决方案

portisdefinedinhttpserver (apacheorotherandmostlyitis 80 or 443 )。

I am sure that :

REMOTE_ADDR '

thegjdxlzaddressfromwhichtheuserisviewingthecurrentpage。

butifyourserverisbehindnat :

ifyouareservingfrombehindaproxyserver,you will almost

certainlysavetimebylookingatwhatthese $ _ servervariablesdoon

your machine behind the proxy。

$ _ server [ ' http _ x _ forwarded _ for ' ] in place of $ _ server [ ' remote _ addr ' ]

$ _ server [ ' http _ x _ forwarded _ host ' ] and

$ _ server [ ' http _ x _ forwarded _ server ' ] in place of

$_SERVER['SERVER_NAME']

:-)

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。