Block IP address


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $deny = array("111.111.111", "222.222.222", "333.333.333");
  3. if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) {
  4. header("location: http://www.google.com/");
  5. exit();
  6. } ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.