Git Product home page Git Product logo

geoip-lookup's Introduction

GeoIP-Lookup

PHP scripts written to quickly query local Maxmind database for IP organization, city, and country information.

Dependencies

  • php5
  • php-mbstring

I paid for a subscription to the Maxmind IP organization database for a nominal fee. I used the lite country and city databases they provide free of charge.

Library Information

The following APIs were provided by the Maxmind and the latest versions can be found on github:

  • geoip.inc
  • geoipcity.inc
  • georegionvars.php

https://github.com/maxmind/geoip-api-php

Directory Setup

The following files need to be configured for your webserver directory structure:

  • index.php
  • geoip.php

The variables are near the top of the scripts and are commented with path information. For testing, I had everything in the top level web directory and a sub directory that held the maxmind database files.

Information

The script provides error checking to insure the information provided is an IP address, it discards any invalid entries. It also allows users to export the results into a randomized CSV file. It is also wise to setup a cronjob to delete old CSV files from the directory where the CSV files are generated. I didn't add this functionality into the script in case these files wanted to be kept long term. The geoip_update.php script was implemented in an older version of the program but is no longer used. I need to update it to auto pull org information from Maxmind. Results are returned very quickly, even when searching for thousands of entries. Make sure you give PHP enough memory resources if you will be doing lots of queries.

I am not a web developer/designer by trade, sorry if the design is a bit dated :).

Screenshots

Main Interface - Smart enough to identify real IP addresses from random text. Also, IP information can be entered in any fashion as long as there is a space between IP addresses.

Main Page

Results - Results are shown in a table. They can be highlighted by mouseover. Results can be exported using the "Export CSV" button.

Results

geoip-lookup's People

Contributors

seth-paxton avatar

Watchers

 avatar

Forkers

geopaymeinc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.