Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定の地域のすべてのユーザーが自分のWebサイトにアクセスするのを制限したいと思います。
PHP を使用してこれを行うことができます。
<?php $ip = $_SERVER['REMOTE_ADDR']; $file = file_get_contents("http://api.hostip.info/?ip={$ip}"); if(stristr($file, 'bad country') === FALSE) { echo 'ya\'ll may visit this here site.'; } else { echo "nope!"; } ?>