V2EX jieke
 jieke 最近的时间轴更新
jieke

jieke

V2EX 第 351053 号会员,加入于 2018-09-20 17:31:10 +08:00
jieke 最近回复了
玩过公众号的也可以去尝试,我之前用公众号实现过相同的功能,现在没用公众号弄了,对我不实用,有兴趣的朋友可以去看下呗。
这个的话,数据库自己可以用 mysql 写一个,然后用这个去访问数据库就可以了
<?php

include("data/config.php");

$id = $_GET['id'];
$sql = "select * from wx_list where id='".$id."'";
$rs = mysql_fetch_array(mysql_query($sql));

$s_time = strtotime (date('Y-m-d'));
$e_time = strtotime ($rs['e_time']);
$r_time = ceil(($e_time - $s_time));
if($r_time <= 0){
echo '
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" cOntent="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0">
<meta name="apple-mobile-web-app-capable" cOntent="yes">
<meta name="apple-mobile-web-app-status-bar-style" cOntent="black">
<meta name="format-detection" cOntent="telephOne=no">
<title>跳转失败</title>
</head>
<body>
<div style="text-align: center;font-size: 18px;margin: 100px 0 30px 0;"></div>
</body>
</html>
';
exit;
}

$count = $rs['count'] + 1;
mysql_query($sql = "update wx_list set count='".$count."' where id='".$id."'");

function get_ticket($code){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$cOntents= curl_exec($ch);
preg_match('/ticket=(.*?)\"/',$contents,$result);
$cOntent= $result[1];
return $content;
}

if(time() - $rs['uptime'] >= 1800) {
$www_url = get_ticket($rs['www_url']);
mysql_query($sql = "update wx_list set ticket='".$www_url."',uptime='".time()."' where id='".$id."'");
} else {
$www_url = $rs['ticket'];
}
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" cOntent="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0">
<meta name="apple-mobile-web-app-capable" cOntent="yes">
<meta name="apple-mobile-web-app-status-bar-style" cOntent="black">
<meta name="format-detection" cOntent="telephOne=no">
<title>正在跳转中</title>
</head>
<body>
<div style="text-align: center;font-size: 18px;margin: 100px 0 30px 0;"></div>
<a href="weixin://dl/business/?ticket=<?php echo $www_url ?>" style="width: 90%;background: #1AAD19;text-align: center;color: #fff;margin: 0 auto;box-sizing: border-box;font-size: 18px;line-height: 2.55555556;border-radius: 5px;display: block;text-decoration: none;">再次跳转</a>
<script>window.location.href="weixin://dl/business/?ticket=<?php echo $www_url ?>";</script>
<!--一起交流了学习,需要整套源码的再联系扣扣:三二二零一久二一八三-->
</body>
</html>
这个很简单的啦,我这边都分享源码给很多需要这个功能的朋友了。
只要开放了接口都是可以调取的
浏览器跳转也是可以这样的呀
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" cOntent="text/html; charset=" />
<title>跳转微信中</title>
<meta cOntent="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport">
<meta cOntent="telephOne=no" name="format-detection">
<meta name="apple-mobile-web-app-capable" cOntent="yes">
<meta name="apple-mobile-web-app-status-bar-style" cOntent="black">
<?php
// 统一调用微信白名单接口: https://wq.jd.com/mjgj/link/GetOpenLink?callback=getOpenLink&rurl=https://dc2.jd.com/auto.php?service=transfer&type=pms&to=(这里是拼接自己的内容地址比如 http://mjbbs.jd.com/data/attachment/forum/201806/08/173526pb2zpjzzooo2ofze.jpg )<!--了解具体流程的联系 QQ:3220192183-->
if($_GET['t']){
// include("admin/config.php");
// include("admin/function.php");
$code = $_GET['t'];
$info = query ( "jump_logs", "where code='" . $code . "'" );
if($info['code'] == ''){
echo '跳转失败';
exit(0);
}
if($info['state'] == '1'){
if($info['count'] >= $info['num']){
echo '跳转失败';
exit(0);
}
$time = strtotime($info['time']);
if(time() > $time){
echo '跳转失败';
exit;
}
}else{
echo '跳转失败';
exit;
}
if($info['www_url'] == ''){
echo '请先配置落地页';
exit;
}else{
$w_url_code = $info['rl'];
}
?>
<style>
*{ margin:0 auto;}html,body{height:100%;}.container {margin-top: 100px;text-align: center;}.icon {width: 70px;height: 70px;}#ellipsis {display: inline-block;width: 0;}
</style>
</head>
<body>
<div class="container">
<p class="text">正在跳转到微信<span id="ellipsis">&#160;&#160;&#160;</span></p></div>
<script type="text/Javascript">
var ellipsis = ['&#160;&#160;&#160;', '.&#160;&#160;', '..&#160;', '...'];
var index = 0;
var $ellipsis = document.getElementById('ellipsis');
setInterval(function () {
$ellipsis.innerHTML = ellipsis[index++ % 4];
}, 500);</script>
<?php
function get_ticket($code){
//初始化
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // https 请求 不验证证书和 hosts
$headers = array();
$headers[] = 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X; zh-CN) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/15B202 UCBrowser/11.7.7.1031 Mobile AliApp(TUnionSDK/0.1.20)';
$headers[] = 'Referer: https://m.mall.qq.com/release/?busid=mxd2&ADTAG=jcp.h5.index.dis';
$headers[] = 'Content-Type:application/x-www-form-urlencoded; charset=';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$cOntent= curl_exec($ch);
curl_close($ch);
//$arr = json_decode($content,1);
//if($arr['success'] == '1'){
// $shotCode = $arr['shotCode'];
//}else{
// $shotCode = '';
//}
//preg_match('/openlink\":\"(.*?)\"}/',$content,$result);
//$url = $result[1];
// <!--要免费源码的伙伴联系 QQ:3220192183-->
preg_match('/href=\"(.*?)#wechat/',$content,$result);
$url = $result[1];
return $url;
}
$time = time()-$info['ticket_time'];
$minute=floor($time/60);
query_update ( "jump_logs", "count=count+1". " where code='" . $code . "'" );
if($minute >= 59){
//如果超过 1 小时,更新 ticket
$url = get_ticket($w_url_code);
if($url){
query_update ( "jump_logs", "ticket_time='".time()."', ticket='" . $url . "' where code='" . $code . "'" );
$ticket_url = $url.'#';
if(strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')||strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')){//安卓百度手机 APP<!--要免费配置环境的联系 QQ:3220192183-->
echo '<script>window.location.href = "bdbox://utils?action=sendIntent&minver=7.4&params=%7b%22intent%22%3a%22'.$url.'%23wechat_redirect%23wechat_redirect%23Intent%3bend%22%7d";</script>';
}else{
echo '<script>window.location.href = "'.$ticket_url.'";</script>';
}
}
}else{
$ticket_url = $info['ticket'].'#';
if(strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')||strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')){//安卓百度手机 APP<!--要免费配置环境的联系 QQ:3220192183-->
echo '<script>window.location.href = "bdbox://utils?action=sendIntent&minver=7.4&params=%7b%22intent%22%3a%22'.$info['ticket'].'%23wechat_redirect%23wechat_redirect%23Intent%3bend%22%7d";</script>';
}else{
echo '<script>window.location.href = "'.$ticket_url.'";</script>';
}
}
}
?>
<!--需要源码的联系 QQ:3220192183-->
</body>
</html>
现在这个功能很成熟,你们需要学习的就过来找我,只要你有兴趣学,肯定能学会的。
有这个项目需求的老铁可以来找 q 我吧(三而而林一久而一巴三),给你代码一口气教你,你懂的也要教我,我们一起互相学习下。
这个功能,你想到微信怎么连接 wifi 就知道怎么实现的,原理一样的
a href="/member/jieke/replies">jieke 创建的更多回复
关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2498 人在线   最高记录 6679       Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 13ms UTC 15:37 PVG 23:37 LAX 08:37 JFK 11:37
Do have faith in what you're doing.
ubao snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86