Hello I want to block all visitors from China and Iran. My site is using automates system on sign up and their country is automatically recorded on sign up but I want to stop these users ? How to do this,do you have any ideas ?
You can use .htaaccess or the "Deny IP" option that some service providers give. I've used the latter to block off some countires successfully.
I know for .htaccess way but I want to use some database which is updated at least once a month.My site use some database on this principle for location country on sign up but I don't know how to deny sign up if member come from China or Iran ....
you can get IP range list for country from here and block them http://www.proxyserverprivacy.com/ipaddress_range.php
you can add some code, in php/asp or whatever the form is created in and then check for the environment variable to check the ip address of the visitor and carry out the actions accordingly.
If you have an Apache server, you can do this without scripting. Scripting will still allow them to poke around your site. Additionally you'd have to do it on all files, and change it every time a new one comes up. This is a little complex, things can go wrong, so fully research before you drop in an .htaccess file with deny directives. Once you are familiar it, it as simple as creating a plain text file containing something like this, and naming it ".htaccess." "#" are comments and will not affect the functioning of the directives. order allow,deny <Limit GET POST> allow from all # specific ip address deny from 123.123.123.123 # deny a range: 123.123.0.0 - 123.123.255.255 deny from 123.123.0.0/16 # the whole class: 123.0.0.0 - 123.255.255.255 deny from 123.0.0.0/8 # shorthand for previous deny from 123 </Limit>
order allow,deny <Limit GET POST> allow from all # specific ip address deny from 123.123.123.123 # deny a range: 123.123.0.0 - 123.123.255.255 deny from 123.123.0.0/16 # the whole class: 123.0.0.0 - 123.255.255.255 deny from 123.0.0.0/8 # shorthand for previous deny from 123 </Limit> order allow,deny <Limit GET POST> allow from all # specific ip address deny from 123.123.123.123 # deny a range: 123.123.0.0 - 123.123.255.255 deny from 123.123.0.0/16 # the whole class: 123.0.0.0 - 123.255.255.255 deny from 123.0.0.0/8 # shorthand for previous deny from 123 </Limit> Can I do in the following format If I have to block more than 1 country's list.