![]() |
IP Based Image - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: IP Based Image (/showthread.php?tid=56517) |
IP Based Image - El Forum - 12-27-2012 [eluser]Unknown[/eluser] Hi, i have a banner area on my website where i would like to display an image. I would like to display a different image in the banner area, depending on a users' location. I have 4 different images: 01 - usa_banner.jpg (default) 02 - europe_banner.jpg 03 - uk_banner.jpg 04 - australia_banner.jpg If a user views the site from a country outside of the top 4 areas, then i would like to display the default usa_banner.jpg image. I have created my site using codeigniter. What is the best way to work out the IP ranges etc. Any advice on this would be greatly appreciated. Thanks in advance... IP Based Image - El Forum - 12-27-2012 [eluser]CroNiX[/eluser] You can use the MaxMind Geolite City database (free version) and use the users IP to get the country and some other data. http://usabilityetc.com/articles/building-geolocator-with-maxmind-geolite-city/ There are also many 3rd party services that can supply the country when giving the ip. IP Based Image - El Forum - 12-27-2012 [eluser]Unknown[/eluser] Cool, thanks... how reliable are these 3rd party services? Would it be a better idea to write your own |