开发者

Need help sending custom info to php global vars

Is is possible to send custom information to $_SERVER[REMOTE_ADDR]; or $_SERVER[HTTP_X_FORWARDED_FOR]; ? I want to make these 开发者_开发技巧vars output my custom text. I thought about editing headers sent by browser or sending it with php script/curl program. But I don't know how. Please tell me if it is possible and how.


You can't change $_SERVER['REMOTE_ADDR'] as that's the IP address of the TCP connection. The only way to change that is to actually connect from a different real IP address.

You can send whatever X-FORWARDED-FOR header you want in the HTTP request. All that header is used for is to hint that the connecting IP is proxying a request for some other client. It's not relied upon for anything important.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜