pranshu82202 Posted July 13, 2011 Share Posted July 13, 2011 Is their any way to get the location where my website is logged in... And how to take the ip of the computer on which my website is logged in.... :shrug: :shrug: Link to comment https://forums.phpfreaks.com/topic/241908-login-location/ Share on other sites More sharing options...
max_w1 Posted July 13, 2011 Share Posted July 13, 2011 yes by using $_SERVER['REMOTE_ADDR'] you can know the persons ip address. Link to comment https://forums.phpfreaks.com/topic/241908-login-location/#findComment-1242286 Share on other sites More sharing options...
pranshu82202 Posted July 13, 2011 Author Share Posted July 13, 2011 Thanx man... Have any idea how to capture the login location... Link to comment https://forums.phpfreaks.com/topic/241908-login-location/#findComment-1242289 Share on other sites More sharing options...
max_w1 Posted July 13, 2011 Share Posted July 13, 2011 Once you get the visitors IP address there are a lot of websites that will tell you where it belongs to. you can just log on to http://www.ip2location.com/ and type the ip address there and get the location. If you want to do it on your website you need to Download the CSV file from (http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip), then import it via PhpMyAdmin application or mysql console into a newly created database. After that, you can use it to do simple queries to detect a country via an ip address. You can see examples on maxmind’s website too. You can also do it by using the PEAR package Net_GeoIP: http://pear.php.net/package/Net_GeoIP. hope it helped. Link to comment https://forums.phpfreaks.com/topic/241908-login-location/#findComment-1242306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.