I want to show country flag depending on ip address I receive at server side. Are fixed ip addresses are assigned to countries ? Where can I get database for ip address to country mapping ?
Take a look at the following:
Also on Stack Overflow:
Once you have the country code, then you can display the flag with these free icon sets which use ISO country codes:
PHP Advent also just published a whole article on a very similar process:
You're looking for an IP geolocation service such as MaxMind.
ip2location.com provides an IP range database which can be used to tag IP addresses
they provide it in different formats as well so you can choose which one is useful to you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With