drisate Posted September 15, 2008 Share Posted September 15, 2008 Hey guys. I am currently working on a weather script and was wandering if it was possible to retrieve the location of the guy and set it as default value. So my question is, if it's possible, how can I get his location? Link to comment https://forums.phpfreaks.com/topic/124386-how-to-retreive-the-location-of-an-ip/ Share on other sites More sharing options...
.josh Posted September 16, 2008 Share Posted September 16, 2008 $_SERVER['REMOTE_ADDR'] will give you an IP address though that's very unreliable, as it can easily be spoofed or hidden. Link to comment https://forums.phpfreaks.com/topic/124386-how-to-retreive-the-location-of-an-ip/#findComment-642455 Share on other sites More sharing options...
discomatt Posted September 16, 2008 Share Posted September 16, 2008 Hey guys. I am currently working on a weather script and was wandering if it was possible to retrieve the location of the guy and set it as default value. So my question is, if it's possible, how can I get his location? You pretty much need a database with locations and ip ranges pre constructed. Most databases I've seen are fee-based. Link to comment https://forums.phpfreaks.com/topic/124386-how-to-retreive-the-location-of-an-ip/#findComment-642457 Share on other sites More sharing options...
DarkWater Posted September 16, 2008 Share Posted September 16, 2008 GeoIP does have basic fee services I think (idk, never used them yet, just read about it). Link to comment https://forums.phpfreaks.com/topic/124386-how-to-retreive-the-location-of-an-ip/#findComment-642459 Share on other sites More sharing options...
burn1337 Posted September 16, 2008 Share Posted September 16, 2008 I too was going to recommend GeoIp, I believe it's integrated into php, I'm probably wrong, I know with the configure options it mentions somethings about geoip but not to sure past that. Link to comment https://forums.phpfreaks.com/topic/124386-how-to-retreive-the-location-of-an-ip/#findComment-642477 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.