Foreign trade station do not want to let China visit, want to use JavaScript to detect browser language is the Chinese are blocked, but will be hurt to a lot of overseas Chinese, and from the statistics on the website overseas Chinese accounted for a lot, with the back-end PHP to determine whether for the mainland to find a half-day and no clue, this should be how to solve?
Reply content:
Foreign trade station do not want to let China visit, want to use JavaScript to detect browser language is the Chinese are blocked, but will be hurt to a lot of overseas Chinese, and from the statistics on the website overseas Chinese accounted for a lot, with the back-end PHP to determine whether for the mainland to find a half-day and no clue, this should be how to solve?
Simply want to block the IP words, need to find the Chinese mainland IP. While the APAC IP is owned by apnic, you can download: http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
Then, according to the country code "CN" to find the Chinese mainland IP.
The specific can be executed in the shell:
wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latestgrep ipv4 delegated-apnic-latest | grep CN | awk -F'|' '{print $4}'
The output is the IP of mainland China.
I have to turn over the wall how do you block ...
PS: Don't want them to see a little bit less realistic, can not let them buy. such as ban off registered mailbox, mobile phone number, mailing address and so on
Look at IP access, if it is a domestic IP shield