/ Published in: PHP
                    
                                        
This Snnipet detect the querys generated by a bot, crawler or spider.
Este Snnipet detecta las peticiones generadas por los bots, Spiders y Crawlers.
                Este Snnipet detecta las peticiones generadas por los bots, Spiders y Crawlers.
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<?php
$robot[] = "googlebot";
$robot[] = "google";
$robot[] = "mediapartners";
$robot[] = "msnbot";
$robot[] = "msn";
$robot[] = "overture";
$robot[] = "lycos";
$robot[] = "seek";
$robot[] = "inktomi";
$robot[] = "yahoo";
$robot[] = "slurp";
$robot[] = "altavista";
$robot[] = "alexa";
$robot[] = "crawler";
$isRobot=false;
foreach($robot as $bot){
$isRobot=true;
break;
}
}
//visitas
if($isRobot){
//// Esta parte es Opcional
$heads = "MIME-Version: 1.0 rn";
$heads .= "Content-type: text/html; charset=utf-8 rn";
$body ="<b>Robot Name:</b> ".$str."<br>";
$body .="<b>Robot Address:</b> ".$_SERVER['REMOTE_ADDR'];
//// Fin de la Parte Opcional
}else{
$vql= "UPDATE bg_articulos SET visitas=visitas+1 WHERE art_id='".$artid."'";
}
?>
URL: http://www.codigolandia.com/art-Detector+de+Bots,+Spider+y+Crawlers-php-114.tc
Comments
 Subscribe to comments
                    Subscribe to comments
                
                