QQ防红代码

QQ防红并跳转默认浏览器方法,下列代码请加入全局文件中

1
2
3
4
5
if (strpos($_SERVER['HTTP_USER_AGENT'], 'QQ/') !== false and $type == "ture") {

      exit('<script src="https://open.mobile.qq.com/sdk/qqapi.js?_bid=152"></script><script type="text/javascript">alert("请从浏览器内打开本站");mqq.ui.openUrl({ target: 2,url: "http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'"});</script>');

    }
Licensed under CC BY-NC-SA 4.0
最后更新于 Aug 15, 2025 15:01 +0800