บทความ

Script การ Check bot หรือ ไม่ที่เข้ามาเว็บเรา

สวัสดีครับ ผมจะนำวิธีการเช็คว่า bot เข้ามาหรือว่าเป็นคนที่เข้ามาสามารถนำไปประยุกต์ใช้งานได้ครับ <?php class checkbot{ function isbot() {   $isbot=""; // Add as many spiders you want in this array $spiders = array('Googlebot', 'Yammybot', 'Openbot', 'Yahoo', 'Slurp', 'msnbot', 'ia_archiver', 'Lycos', 'Scooter', 'AltaVista', 'Teoma', 'Gigabot', 'Googlebot-Mobile'); // Loop through each spider and check if it appears in // the User Agent foreach ($spiders as $spider) { if (eregi($spider, $_SERVER['HTTP_USER_AGENT'])) {   $isbot="true"; return $isbot; } } $isbot="fail"; return $isbot; } //echo check_if_spider(); } ?> วิธีการใช้งานก็ง่ายๆ include("includes/botchecker.php"); $isbot=checkbot::isbot(); e...