{"id":15971345,"url":"https://github.com/danielholmes/ip-detect","last_synced_at":"2026-07-17T12:31:11.721Z","repository":{"id":145825357,"uuid":"12204869","full_name":"danielholmes/ip-detect","owner":"danielholmes","description":"Utility to work with MaxMind GeoIP Country IP CSV","archived":false,"fork":false,"pushed_at":"2013-08-19T01:48:57.000Z","size":1360,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T01:41:22.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielholmes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-19T01:37:46.000Z","updated_at":"2014-05-04T00:10:14.000Z","dependencies_parsed_at":"2023-04-10T04:50:51.473Z","dependency_job_id":null,"html_url":"https://github.com/danielholmes/ip-detect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fip-detect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fip-detect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fip-detect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fip-detect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielholmes","download_url":"https://codeload.github.com/danielholmes/ip-detect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208063,"owners_count":20901568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T20:21:05.232Z","updated_at":"2025-10-15T16:49:05.503Z","avatar_url":"https://github.com/danielholmes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple IP Address Detection\n===========================\n\nReads in the Geolite database (CSV Format not binary) and detects if a given IP Address is within it.\n\nFor more information on the Geolite database see:\n\n* [Home Page](http://dev.maxmind.com/geoip/legacy/geolite/)\n* [Direct download link](http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip)\n\nUsage\n-----\nFor an example usage, see example.php. The general idea is that you would save a subset of the full\nCSV database to ranges.csv and then use that. For example if I wanted to redirect all Australian\nusers to a different url I would do the following (where `GeoIPCountryWhois.csv` is the full \ndatabase):\n\n 1. `grep \"Australia\" GeoIPCountryWhois.csv \u003e\u003e ranges.csv`\n 2. Copy `ranges.csv` and `ip-detect.php` to your website\n 3. Use the following code at the top of your website files (or within your source code as needed): \n\n```php\n\nrequire_once(dirname(__FILE__) . '/ip-detect.php');\n\n// Redirect the visitor if their IP is in ranges.csv\n// i.e. Redirect the visitor if their IP is recognised as Australian\nif (isInIpRanges($_SERVER['REMOTE_ADDR']))\n{\n    header('Location: http://www.example.org/australian-site');\n}\n\n// Rest of website code\n```\n\nRunning Tests\n-------------\n`php tests.php`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielholmes%2Fip-detect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielholmes%2Fip-detect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielholmes%2Fip-detect/lists"}