Return to Snippet

Revision: 24274
at February 25, 2010 03:34 by rccc


Updated Code
//first example
    
$moteurs = array("bot", "search", "google", "msn, "yahoo", "slirp", "aol");

  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="";

Revision: 24273
at February 25, 2010 03:32 by rccc


Initial Code
//first example
    
  $moteurs = array("bot", "search", "google", "msn, "yahoo", "slirp", "aol");

      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="";

Initial URL

                                

Initial Description

                                

Initial Title
check search engine bot

Initial Tags

                                

Initial Language
PHP