How do I limit which countries can view my website ( PHP )

后端 未结 6 2084
盖世英雄少女心
盖世英雄少女心 2020-12-30 07:44

In there an easy way to do this in PHP. I want to make sure that only web requests from certain countries are able to access my website.

Any ideas?

6条回答
  •  难免孤独
    2020-12-30 08:15

    Both of the answers (geolocation, user agent) will work but can be defeated. Someone can use a proxy server, or change their user agent. Firefox even has a plugin for that purpose.

提交回复
热议问题