Board index   FAQ   Search  
Register  Login
Board index Web Development Forums PHP Forum

Is there a way to block a country?

PHP programming, Hypertext Preprocessor, Learn php coding, tutorials, discussions and help.

Is there a way to block a country?

Postby Sofia » Mon Aug 06, 2012 5:24 am

Looks like I'm getting spam via my registration page, even with a CAPTCHA image. Is there a way (simple) to block a country to see my site?
Like China or Russia?

I'm actually only interested in the U.S. market, some code can only make my site available to the U.S.?

Thanks for any insight.


"Apache on Linux"
Sofia
 
Posts: 1102
Joined: Tue Dec 21, 2010 12:42 pm

Re: Is there a way to block a country?

Postby Alexander » Mon Aug 06, 2012 5:26 am

Use .htaccess in that case.

Code: Select all
http://www.javascriptkit.com/howto/htaccess5.shtml


country IP list are available from ->
Code: Select all
http://software77.net/geo-ip/



Using iptables is much better, but if you do not have that level of access there is no choice. Using PHP will actually increase the load on the server that is likely to cause performance degradation.
Alexander
 
Posts: 1165
Joined: Tue Dec 21, 2010 12:46 pm


Return to PHP Forum

Who is online

Users browsing this forum: No registered users and 3 guests

cron