zoukankan      html  css  js  c++  java
  • 微信公共号的PHP开发(基础篇)——玩一下

      最近没事儿开了个微信号,写点东西给家人啊什么的看,你们想看的话就这个嘛:

    然后就意外的看到imooc上的微信公众号开发相关了。每天科研的累累的,做点这个不是很累的东西吧。

    微信公共号开发

    一、基础

    1.1 数据交互流程

    用户《————》微信服务器《————》第三方服务器;

    且,由左向右都是request,由右向左都是response;

    1.2 API

    --配置

    接入API

     输入这两个——所以,要事先准备好服务器,我用的是腾讯的,反正都是一家的,更方便一点吧。

    $timestamp=$_GET['timestamp'];
    $nonce=$_GET['nonce'];
    $token='weixin';
    $signature=$_GET['signature'];
    $array=array($timestamp,$nonce,$token);
    sort($array);
    $tmpstr=implode('',$array);
    $tmpstr=sha1($tmpstr);
    if ($tmpstr==$signature){
      echo $_GET['echostr'];
      exit;
    }

    主要就这么一段代码,放在你要链接到的url即可。

    具体为什么,是根据weixin规定的来的吧,我也不是很懂,要去查一下。

    明天开发点东西玩下

  • 相关阅读:
    20-存储过程
    21-事务
    18-触发器
    19-函数
    16-pymysql模块的使用
    17-视图
    CodeForces 1369B. AccurateLee
    CodeForces 1312D.Count the Arrays(组合数学)
    CodeForces 1362D. Johnny and Contribution
    CodeForces 1363F. Rotating Substrings
  • 原文地址:https://www.cnblogs.com/andy1202go/p/5499463.html
Copyright © 2011-2022 走看看