問題描述
我在我的 web 項目的 jsp/servlet 中創建了一個登錄應用程序,我想知道訪問我的登錄頁面的不同用戶的地理位置.我怎么知道有人從哪里訪問我的登錄頁面?例如:如果一個人從加拿大訪問一個頁面,那么一條記錄將插入到我的數據庫中,例如:IP:20.4.9.134 和位置:加拿大.
I have created a login application in jsp/servlet in my web project and I want to know about the geographic locations of different users those access my login page. How can I know that a person is accessing my login page from where? For example: If a person is accessing a page from Canada then a record will be inserted into my database such as : IP: 20.4.9.134 and location: Canada.
推薦答案
我用這個:
http://freegeoip.net/xml/122.169.8.137
或者
http://www.geoplugin.net/xml.gp?ip=xx.xx.xx.xx
簡單的調用,它會給你一個包含你需要知道的一切的 xml
Easy call and it throws you an xml with everything you need to know
geoip 的新位置
這篇關于如何從 IP 地址獲知地理位置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!