PHP get the client and server IP

Client IP-related variables

1. $ _ SERVER [ 'REMOTE_ADDR'] Client IP, there may be a user's IP, which may be a proxy IP.

2. $ _ IP SERVER [ 'HTTP_CLIENT_IP'] Agent, there may be forged.

3. $ _ SERVER [ 'HTTP_X_FORWARDER_FOR'] is the user agent in which IP is used, there may be, you can be forged.

4. $ _ SERVER [ 'SERVER_ADDR'] acquired IP server

Guess you like

Origin blog.csdn.net/qq_27084325/article/details/93713466