Post
Topic
Board Micro Earnings
Re: FaucetBOX.com Discussion
by
Salmen
on 02/04/2016, 19:25:44 UTC
Hi, freegeoip.net is no longer going to work stable. My question is what alternative can be used? I use geolocation to pay users.
I believe CloudFlare can provide user's location in a custom HTTP header. Not only it will be stable, it'll also be much faster (as you won't need extra http request to external service).
If this doesn't work for you, you can use the other geo-location service I mentioned a page back in this way:
Code:
$countryCode = json_decode(file_get_contents('http://geoip.nekudo.com/api/' . getIP()))->country->code;
I'm not sure but Remote addr won't work with cloudflare. I had the problem and it worked with x-forwarded for.
Remote address return the ip of the cloudflare server.
You may look here

I hope I can help you.

Cheers
Salmen