/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//first example foreach ($moteurs as $moteur){ if (strstr(strtolower($_SERVER['USER_AGENT']), $moteur)){ $refisbot = 1; break; } } if (!$refisbot) session_start(); //second example $UA=$_SERVER["HTTP_USER_AGENT"]; $brow = strtolower($UA);//en minuscules pour toutes les versions $bots = array ("antibot","appie1.1","archive","ask","askjeeves","baiduspider","converacrawler","deepIndex","dloader","exabot","fast","fluffy","gigabot","girafabot","google","google adsence","googlebot","googlebot-image","grub.org","henrilerobotmirago","heritrix","holmes","httrack","ia_archiver","ichiro","inktomi slurp","java","larbin","lwp-trivial","mediapartners-google","mj12bot","msnbot","msnbot-media","msiecrawler","msrbot","netresearchserver","nimblecrawler","nutch","nutchcvs","openbot","openfind","picsearch","pompos","psbot","python-urllib","sbider","seekbot","scooter","shinchakubin","slurp","spider","stackramber","surveybot","szukacz","teoma","voila","voilabot","voyager","webcrawler","xenu link sleuth","yandex","yahoo","yahoo!","yahoo-mmcrawler","yahooseeker","zyborg");//on ajoute ici les noms des autres robots en minuscules $n=0;$robotstat="vide";$robot="";