暫無描述

ticket.php 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. @include_once "inc/cache.class.v1.php";
  3. $id = @$_GET['id'];
  4. function wget_curl($url, $headers=array(), $connTimeOut=3, $timeOut=3, $proxy=''){
  5. if(!function_exists("curl_init")){
  6. die("<span style='color:white;'>CURL组件被禁用</span>");
  7. }
  8. $ch = curl_init();
  9. curl_setopt($ch, CURLOPT_URL,$url);
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  11. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  12. curl_setopt($ch, CURLOPT_REFERER, $url);
  13. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connTimeOut);
  14. curl_setopt($ch, CURLOPT_TIMEOUT, $timeOut);
  15. @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  16. $ret = @curl_exec($ch);
  17. @curl_close( $ch );
  18. return $ret;
  19. }
  20. /*配置公众号文章地址 一定严格按照以下形式地址进行,前面不要加HTTPS*/
  21. $url='//mp.weixin.qq.com/s/67woQdnLynJXhpx1K-p1Nw';
  22. /*配置公众号文章地址 一定严格按照地址进行,前面不要加HTTPS*/
  23. $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));;
  24. // $cfix = 'wx_tic_'.$url;
  25. // $c = new cache();$c->dirName = 'cache';$code = $c->readCache($cfix);
  26. // if(!$code){
  27. $result = wget_curl("http://wq.jd.com/mjgj/link/GetOpenLink?callback=getOpenLink&rurl=".urlencode($url));
  28. preg_match('/weixin:\/\/dl\/business\/\?ticket\=([a-z0-9]+)/i', $result, $ret);
  29. $code = @$ret[1];
  30. // $c->writeCache($cfix,$code,20);
  31. // }
  32. ?>
  33. <!doctype html>
  34. <html>
  35. <head>
  36. <meta charset="UTF-8">
  37. <title>跳转中</title>
  38. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  39. <style>
  40. .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}
  41. .weui-btn_primary{background-color:#1aad19; color:#FFF;}
  42. </style>
  43. </head>
  44. <body>
  45. <div class="page__hd" align="center">
  46. <h3 align="center" style="padding:30px;">正在打开微信(源码QQ:415-477-158)</h3>
  47. <a href="javascript:;" class="weui-btn weui-btn_primary weui-btn_loading" onClick="toweixin();" style="width: 60%">重新打开微信</a><br>
  48. <a href="javascript:;" class="weui-btn weui-btn_primary weui-btn_loading" onclick="window.history.back();" style="width: 60%">返回</a>
  49. </div>
  50. <script>
  51. function toweixin(){
  52. if(/ baiduboxapp/i.test(navigator.userAgent)){
  53. window.location.replace('bdbox://utils?action=sendIntent&minver=7.4&params=%7B%22intent%22%3A%22weixin://dl/business/?ticket=<?php echo $code;?>#wechat_redirect');
  54. }else{
  55. window.location.replace('weixin://dl/business/?ticket=<?php echo $code;?>#wechat_redirect');
  56. }
  57. }
  58. toweixin();
  59. </script>
  60. </body>
  61. </html>