Include the IP info of:
as default IP to locate the Country Info.
If the client uses a proxy server
or load balancing server
might not be the real Public IP. The real Public IP might defined in HTTP_CLIENT_IP
is detected, it will be the real public IP for him/her.
is not existed, look for HTTP_X_FORWARDED_FOR
contains a list of IP separated by comma+space. Official format sequence of IP is:
- Client IP, Proxy IP 1, Proxy IP 2....
but, unfortunately, not all the manufacturers or operators are following this sequence. There are lots of possibilities. However within the list of IP, only one IP (Public IP) is valid which represent him/her on global network on earth.
But, the bad news is, all HTTP_xxxx
headers can be easily modified by user. User can use any IP address as they like. But this happens rarely, approximately 1% of your client might do this. (Normal user won't edit their http headers to trick your website). Therefore, the only reliable IP for identifying the origin of the client's country is REMOTE_ADDR
and this database introduce by this tool can only retrieve Country from the IP (no Cities and Regions info), you can just stick to REMOTE_ADDR