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
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
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., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho