Rate this script:  I Love it  /   I Hate it

Banning bad bots


Code


<?php
$i = getenv('REMOTE_ADDR');
$handle = fopen("../.htaccess", "a");
fwrite($handle, "Deny from $i\n");
fclose($handle);
echo "You've just got $i banned from this domain.  You are a very bad person.";
mail("webmaster@example.com", "Banned IP", "Deny from $i");
?>
 

 

 
Banning bad bots scripts | Banning bad bots snippet | Banning bad bots example | Banning bad bots tutorial | Banning bad bots code