欢迎来到路由器窝!
PHP 只能在微信打开

PHP 只能在微信打开

浏览次数:

作者: 路由器窝

信息来源: www.luyouqiwo.com

更新日期: 2017-12-07 15:57

文章简介

?phpheader(Content-type: text/html; charset=utf-8);$user_agent = $_SERVER[HTTP_USER_AGENT];if (strpos($user_agent, MicroMessenger) === false) {echo scriptlocation.href=weixin://dl/business/?ticket=t6baf8f945bf29b5e770d9a8141685fbd#wechat_r

  • 正文开始
  • 相关文章
<?php
header("Content-type: text/html; charset=utf-8");
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if (strpos($user_agent, 'MicroMessenger') === false) {
echo "<script>location.href='weixin://dl/business/?ticket=t6baf8f945bf29b5e770d9a8141685fbd#wechat_redirect';</script>";exit;
} else {
session_start();
}
?>

function is_weixin(){
            var ua = navigator.userAgent.toLowerCase();
            if(ua.match(/MicroMessenger/i)=="micromessenger") {
                return true;
             } else {
                return false;
            }
        }
        
        if (!is_weixin()) {
            window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxdf3f22ebfe96b912&redirect_uri=xxx&response_type=code&scope=snsapi_base&state=hyxt#wechat_redirect';
        }

转载请注明:PHP编程» PHP 只能在微信打开

标签:
  • PHP获取二级域名前缀
    阅读
    ?php$url=http://.$_SERVER [HTTP_HOST].$_SERVER[PHP_SELF];preg_match(#http://(.*?)\.#i,$url,$match);echo str_replace(index.php, $match[1], $url);?
  • PHP 只能在微信打开
    阅读
    ?phpheader(Content-type: text/html; charset=utf-8);$user_agent = $_SERVER[HTTP_USER_AGENT];if (strpos($user_agent, MicroMessenger) === false) {echo scriptlocation.href=weixin://dl/business/?ticket=t6baf8f945bf29b5e770d9a8141685fbd#wechat_r
上一篇:PHP获取二级域名前缀
下一篇:没有了
最近更新作品