{"id":391,"date":"2006-11-17T15:59:23","date_gmt":"2006-11-17T13:59:23","guid":{"rendered":"http:\/\/www.wjst.de\/blog\/downloads\/geo-ip-identification\/"},"modified":"2007-03-30T09:37:51","modified_gmt":"2007-03-30T08:37:51","slug":"geo-ip-identification","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2006\/11\/geo-ip-identification\/","title":{"rendered":"Geo IP identification"},"content":{"rendered":"<p>The Geo IP database is available at <a href=\"http:\/\/www.maxmind.com\/app\/geoip_country\">Maxmind<\/a> and allows to trace your home city from IP addresses. Here is a quick and dirty script to upload the Geo IP data into MySQL:<\/p>\n<p>|wj_geo.cmd|<\/p>\n<p>I would also put an index on loc_id. Finally the database should be available as<br \/>\n<code><br \/>\nSELECT city<br \/>\nFROM GeoLiteCity INNER JOIN GeoLiteCityBlocks ON GeoLiteCity.locID = GeoLiteCityBlocks.locID<br \/>\nWHERE $myIP >= startIpNum AND $myIP <= endIpNum;\n<\/code><\/p>\n<p>where $myIP is calculated as<br \/>\n<code><br \/>\nsubstr($_SERVER['REMOTE_ADDR'],0,3) * 16777216 +<br \/>\nsubstr($_SERVER['REMOTE_ADDR'],4,3) * 65536 +<br \/>\nsubstr($_SERVER['REMOTE_ADDR'],8,3) * 256 +<br \/>\nsubstr($_SERVER['REMOTE_ADDR'],12,3)<br \/>\n<\/code><\/p>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 09.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>The Geo IP database is available at Maxmind and allows to trace your home city from IP addresses. Here is a quick and dirty script to upload the Geo IP data into MySQL: |wj_geo.cmd| I would also put an index on loc_id. Finally the database should be available as SELECT city FROM GeoLiteCity INNER JOIN &hellip; <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2006\/11\/geo-ip-identification\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Geo IP identification<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[1],"class_list":["post-391","post","type-post","status-publish","format-standard","hentry","category-genetics-biology","tag-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":0,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}