Most of us should be relying on the server side environmental variable REMOTE_ADDR solely for client IP addresses.
But how to get the real IP address, when the user is visiting your website from a proxy server. Because at that time REMOTE_ADDR may not return the true IP address of the client.
If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine. So here is a simple function in PHP to find the real IP address of the client’s machine.
To read more about this article Click Here
To view the source code Click Here
But how to get the real IP address, when the user is visiting your website from a proxy server. Because at that time REMOTE_ADDR may not return the true IP address of the client.
If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine. So here is a simple function in PHP to find the real IP address of the client’s machine.
To read more about this article Click Here
To view the source code Click Here
0 comments:
Post a Comment