火狼资源网

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2436|回复: 0

手机QQ点击进去网页自动跳转到手机默认的浏览器代码分享

[复制链接]

3

主题

3

帖子

15

积分

新手上路

Rank: 1

积分
15
发表于 2019-5-7 17:25:54 | 显示全部楼层 |阅读模式
本帖最后由 jssk123 于 2019-5-7 17:28 编辑

效果:手机QQ点击进去网页就自动跳转到手机默认的浏览器
使用办法:放置在公共的PHP文件中

  1. $scriptpath = str_replace('\\', '/', $_SERVER['SCRIPT_NAME']);
  2. $sitepath = substr($scriptpath, 0, strrpos($scriptpath, '/'));
  3. $siteurl = ($_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $sitepath . '/';
  4. if (strpos($_SERVER['HTTP_USER_AGENT'], 'QQ/') !== !1 ) {
  5. echo '<!DOCTYPE html>
  6. <html>
  7. <head>
  8.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9.   <title>请使用浏览器打开</title>
  10. <script src="https://open.mobile.qq.com/sdk/qqapi.js?_bid=152"></script>
  11. <script type="text/javascript"> mqq.ui.openUrl({ target: 2,url: window.location.href}); </script>
  12. <body>
  13. <div>
  14. 为了让你有更好的使用体验,请使用浏览器打开<br>
  15. 或者点击返回键返回对话



  16. </div>
  17. </body>
  18. </html>';
  19. exit;


  20. /*
  21. 反腾讯网址安全检测系统
  22. Description:屏蔽腾讯电脑管家网址安全检测
  23. Version:2.5
  24. Author:消失的彩虹海
  25. */
  26. if($nosecu==true)return;
  27. //IP屏蔽
  28. $iptables='977012992~977013247|977084416~977084927|1743654912~1743655935|1949957632~1949958143|2006126336~2006127359|2111446272~2111446527|3418570752~3418578943|3419242496~3419250687|3419250688~3419275263|3682941952~3682942207|3682942464~3682942719|3682986660~3682986663|1707474944~1707606015|1884967642|1884967620|1893733510|1709332858|1709318620|1709325774|1709342057|1709341968|1709330358|1709335492|1709327575|1709327041|1709318626|1709318617|1709327557|1709327573|1975065457|1902908741|1902908705|3029946827';
  29. $remoteiplong=bindec(decbin(ip2long(real_ip())));
  30. foreach(explode('|',$iptables) as $iprows){
  31.     if($remoteiplong==$iprows)exit('欢迎使用!');
  32.     $ipbanrange=explode('~',$iprows);
  33.     if($remoteiplong>=$ipbanrange[0] && $remoteiplong<=$ipbanrange[1])
  34.         exit('欢迎使用!');
  35. }
  36. //HEADER特征屏蔽
  37. if(preg_match("/manager/", strtolower($_SERVER['HTTP_USER_AGENT'])) || preg_match("/QZONEJSSDK/", $_SERVER['HTTP_USER_AGENT']) || strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla')===false && strpos($_SERVER['HTTP_USER_AGENT'], 'ozilla')!==false || preg_match("/Windows NT 6.1/", $_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_ACCEPT']=='*/*' || preg_match("/Windows NT 5.1/", $_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_ACCEPT']=='*/*' || preg_match("/vnd.wap.wml/", $_SERVER['HTTP_ACCEPT']) && preg_match("/Windows NT 5.1/", $_SERVER['HTTP_USER_AGENT']) || isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'urls.tr.com')!==false || isset($_COOKIE['ASPSESSIONIDQASBQDRC']) || empty($_SERVER['HTTP_USER_AGENT']) || preg_match("/Alibaba.Security.Heimdall/", $_SERVER['HTTP_USER_AGENT'])) {
  38.     exit('欢迎使用!');
  39. }
  40. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone OS 9_3_4')!==false && $_SERVER['HTTP_ACCEPT']=='*/*' || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone OS 8_4')!==false && $_SERVER['HTTP_ACCEPT']=='*/*' || strpos($_SERVER['HTTP_USER_AGENT'], 'Android 6.0.1')!==false && strpos($_SERVER['HTTP_USER_AGENT'], 'MQQBrowser/6.8')!==false && $_SERVER['HTTP_ACCEPT']=='*/*' || strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'en')!==false && strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'zh')===false || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')!==false && strpos($_SERVER['HTTP_USER_AGENT'], 'en-')!==false && strpos($_SERVER['HTTP_USER_AGENT'], 'zh')===false) {
  41.     exit('您当前浏览器不支持或操作系统语言设置非中文,无法访问本站!');
  42. }



  43. }
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|火狼资源网

GMT+8, 2019-6-17 17:47 , Processed in 0.089653 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表