Php判断蜘蛛和移动端的代码
作者:admin 日期:2022-10-24
PHP代码
- function isgood()
- {
- $a = strtolower($_SERVER['HTTP_USER_AGENT']);
- if (!emptyempty($a)) {
- $b = array('Googlebot', 'Yahoo', 'Bing');
- foreach ($b as $c) {
- $d = strtolower($c);
- if (strpos($a, $d) !== false) {
- return $d;
- }
- }
- } else {
- return false;
- }
- }
- function isMobile()
- {
- if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) {
- return "1";
- }
- if (isset($_SERVER['HTTP_VIA'])) {
- return stristr($_SERVER['HTTP_VIA'], "wap") ? "1" : "0";
- }
- if (isset($_SERVER['HTTP_USER_AGENT'])) {
- $e = array('nokia', 'sony', 'ericsson', 'mot', 'samsung', 'htc', 'sgh', 'lg', 'sharp', 'sie-', 'philips', 'panasonic', 'alcatel', 'lenovo', 'iphone', 'ipod', 'blackberry', 'meizu', 'android', 'netfront', 'symbian', 'ucweb', 'windowsce', 'palm', 'operamini', 'operamobi', 'openwave', 'nexusone', 'cldc', 'midp', 'wap', 'mobile');
- if (preg_match("/(" . implode('|', $e) . ")/i", strtolower($_SERVER['HTTP_USER_AGENT']))) {
- return "1";
- }
- }
- if (isset($_SERVER['HTTP_ACCEPT'])) {
- if (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false && (strpos($_SERVER['HTTP_ACCEPT'], 'text/html') === false || strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'], 'text/html'))) {
- return "1";
- }
- }
- return "0";
- }
以上代码来源于本人破解的php木马。






评论: 0 | 引用: 0 | 查看次数: 171
发表评论
广告位