123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- @include_once "inc/cache.class.v1.php";
- $id = @$_GET['id'];
- function wget_curl($url, $headers=array(), $connTimeOut=3, $timeOut=3, $proxy=''){
- if(!function_exists("curl_init")){
- die("<span style='color:white;'>CURL组件被禁用</span>");
- }
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch, CURLOPT_REFERER, $url);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connTimeOut);
- curl_setopt($ch, CURLOPT_TIMEOUT, $timeOut);
- @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- $ret = @curl_exec($ch);
- @curl_close( $ch );
- return $ret;
- }
- /*配置公众号文章地址 一定严格按照以下形式地址进行,前面不要加HTTPS*/
- $url='//mp.weixin.qq.com/s/67woQdnLynJXhpx1K-p1Nw';
- /*配置公众号文章地址 一定严格按照地址进行,前面不要加HTTPS*/
- $url='https://wqs.jd.com/ad/jump.shtml?curl=http://h5.m.jd.com/active/openappextend/switchpage.html?murl='.urlencode('//e-m.jd.com/refresh.html?refreshLink='.urlencode($url));;
- // $cfix = 'wx_tic_'.$url;
- // $c = new cache();$c->dirName = 'cache';$code = $c->readCache($cfix);
- // if(!$code){
- $result = wget_curl("http://wq.jd.com/mjgj/link/GetOpenLink?callback=getOpenLink&rurl=".urlencode($url));
- preg_match('/weixin:\/\/dl\/business\/\?ticket\=([a-z0-9]+)/i', $result, $ret);
- $code = @$ret[1];
- // $c->writeCache($cfix,$code,20);
- // }
- ?>
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>跳转中</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <style>
- .weui-btn{position: relative;display: block;margin-left: auto;margin-right: auto;padding-left: 14px;padding-right: 14px;box-sizing: border-box;font-size: 18px;text-align: center;text-decoration: none;color: #fff;line-height: 2.55555556;border-radius: 5px;-webkit-tap-highlight-color: rgba(0,0,0,0);overflow: hidden}
- .weui-btn_primary{background-color:#1aad19; color:#FFF;}
- </style>
- </head>
- <body>
- <div class="page__hd" align="center">
- <h3 align="center" style="padding:30px;">正在打开微信(源码QQ:415-477-158)</h3>
- <a href="javascript:;" class="weui-btn weui-btn_primary weui-btn_loading" onClick="toweixin();" style="width: 60%">重新打开微信</a><br>
- <a href="javascript:;" class="weui-btn weui-btn_primary weui-btn_loading" onclick="window.history.back();" style="width: 60%">返回</a>
- </div>
- <script>
- function toweixin(){
- if(/ baiduboxapp/i.test(navigator.userAgent)){
- window.location.replace('bdbox://utils?action=sendIntent&minver=7.4¶ms=%7B%22intent%22%3A%22weixin://dl/business/?ticket=<?php echo $code;?>#wechat_redirect');
- }else{
- window.location.replace('weixin://dl/business/?ticket=<?php echo $code;?>#wechat_redirect');
- }
- }
- toweixin();
- </script>
- </body>
- </html>
|