Is there a way to deny a user access to a webpage based on their IP origin? For instance, if I wanted ONLY U.S. IP addresses accessing my site, how would I go about doing this? I have a hosting account with a hosting company, so I dont have access to the web server directly, so the only option that I know of is to limit the visitors access based on IP once they try to access the site.
The first thing would be do get access to any data that marries up IP addresses to countries.
none of the ip-country DBs are 100% accurate but:
word of advice, don't use the db based versions, use a binary one. much much faster.
we have one as well (mainly aimed at finding users' locales via IP & CGI/browser
vars) but it's data has not been updated in a while: