Advertisement
Guest User

Untitled

a guest
Jan 24th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2.  
  3. // Bot-detection Script by Christopher Mills - www.imod.co.za
  4.  
  5. $to = ""; // insert receiving email address
  6. $from = ""; // insert sending email address
  7. $body = "";
  8. $bots = array('Googlebot', 'Yahoo', 'MSN'); //add the bots you want
  9.  
  10. foreach ($bots as $bot)
  11.     {
  12.         if (eregi($bot, $_SERVER['HTTP_USER_AGENT']))
  13.         {
  14.             $subject = "BOT DETECTED: " . $_SERVER['HTTP_USER_AGENT'];
  15.             if (mail($to, $subject, $body, $from))
  16.             {
  17.                   // nudda
  18.             }  
  19.         }
  20.     }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement