Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Python, Lua and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, C, C++, Ruby, MySQL and Linux / Tomcat systems
I need to block users from creating an account...

Posted by jonbond (jonbond), 7 August 2007
I need to block users from creating an account if they do not live within 60 miles of my city.  Is this possible by looking up the ip address info?  Any ideas, or where to start?  

My web page is hosted on, so I cant install any packages.  I do have php v4.3 installed and mysql.

Thanks in advance for any help or direction.

Posted by admin (Graham Ellis), 7 August 2007
No, it's not possible.

But you can get some way towards it.

If you have a look at (there are others too), they have a database of IP addresses that map to countries and there is an open source version there.  I have that "included" on our pages and use it routinely to identify which country visitors come from.   So you can exclude people from out of country (it's around 98% accurate to my knowledge).

Maxmind (and others) do more detailed databases that will give you greater granularity, but only to some extent, and at a price.   You will never find a database that tells you the latitude and longitude of each IP to sort out your magic figure of 60 miles,  and there will always be proxy servers around which make people who are near you look like they are distant, and vice versa!

Posted by jonbond (jonbond), 8 August 2007
Thank you Graham.  Much appreciated.

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2018: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: • WEB: • SKYPE: wellho