How to obtain the real ip address of the client? I want to know how to get the real IP address of the client. I think everything on the Internet is available. Is there any authoritative document or statement? Which of the following statements are popular on the Internet? 1. if the proxy server is not used: REMOTE_ADDR = your IPHTTP_VIA = no value or no HTTP_X_F is displayed. how can I obtain the real ip address of the client?
I want to know how to get the real IP address of the client. I think everything on the Internet is available. Is there any authoritative document or statement?
Which of the following statements are popular on the Internet?
I. no proxy server is used:
REMOTE_ADDR = your IP address
HTTP_VIA = no value or no Display
HTTP_X_FORWARDED_FOR = no value or no Display
II. Transparent Proxy Server: [Transparent Proxies]
REMOTE_ADDR = IP address of the last proxy server
HTTP_VIA = proxy server IP address
HTTP_X_FORWARDED_FOR = your real IP address. when multiple proxy servers are used, this value is similar to the following: 211.98.182.163, 211.98.182.163, 211.129.72.215.
The transparent proxy server still forwards your information to your access object, which cannot hide your real identity.
III. normal Anonymous proxy server: Anonymous Proxies
REMOTE_ADDR = IP address of the last proxy server
HTTP_VIA = proxy server IP address
HTTP_X_FORWARDED_FOR = proxy server IP address. when multiple proxy servers are used, this value is similar to the following: 111.98.182.163, 211.129.72.215.
The normal anonymous proxy server hides your real IP address, but discloses to the access object that you use the proxy server to access them.
IV. destorting Proxies
REMOTE_ADDR = proxy server IP address
HTTP_VIA = proxy server IP address
HTTP_X_FORWARDED_FOR = random IP address. when multiple proxy servers are used, the value is as follows: 111.98.12.163, 111.98.12.163, 111.19.72.25.
The fraudulent proxy server tells the access object that you have used the proxy server, but fabricated a false random IP address instead of your real IP address to cheat it.
5. High Anonymity Proxies (Elite proxies)
REMOTE_ADDR = proxy server IP address
HTTP_VIA = no value or no Display
HTTP_X_FORWARDED_FOR = no value or no display.
The proxy server information replaces all your information, just as you directly access the object using the proxy server. This is the benefit of high anonymity ..
------ Solution --------------------
It should be similar
------ Solution --------------------
However, it is not feasible.
PHP code
// Obtain the IP address, from DZFunction getIp () {$ Ip = ''; if (getenv ('http _ CLIENT_IP ') & strcasecmp (getenv ('http _ CLIENT_IP '), 'Unknown') {$ Ip = getenv ('http _ CLIENT_IP ');} elseif (getenv ('http _ X_FORWARDED_FOR ') & strcasecmp (getenv ('http _ X_FORWARDED_FOR'), 'Unknown ')) {$ Ip = getenv ('http _ X_FORWARDED_FOR ');} elseif (getenv ('remote _ ADDR') & strcasecmp (getenv ('remote _ ADDR '), 'unknon') {$ Ip = getenv ('remote _ ADDR ');} elseif (isset ($ _ SERVER ['remote _ ADDR']) & $ _ SERVER ['remote _ ADDR '] & strcasecmp ($ _ SERVER ['remote _ ADDR'], 'Unknown ')) {$ Ip = $ _ SERVER ['remote _ ADDR '];} return $ Ip ;}
------ Solution --------------------
Discussion
However, it is not feasible.
PHP code
// Obtain the IP address, from DZ
Function getIp (){
$ Ip = '';
If (getenv ('http _ CLIENT_IP ') & strcasecmp (getenv ('http _ CLIENT_IP'), 'Unknown ')){
$ Ip = getenv ('http _ CLIENT_IP ');......