mysql - php微信公众号开发 小问题 求大牛高手解答下

WBOY
Release: 2016-06-06 20:23:00
Original
1004 people have browsed it

开发的时候,用户关注微信后。我把用户的信息 openid nickname city sex 等信息 存在了我自己的数据库里userinfo表中 那么问题来了 用户通过我的微信公众号点进去一个我自己开发的页面 怎么才能识别是这个用户点进来的 然后从数据库把他的信息等 显示在网页里 openid 是唯一的 那么通过什么把联系起来呢 新手求解答 拜谢了

回复内容:

开发的时候,用户关注微信后。我把用户的信息 openid nickname city sex 等信息 存在了我自己的数据库里userinfo表中 那么问题来了 用户通过我的微信公众号点进去一个我自己开发的页面 怎么才能识别是这个用户点进来的 然后从数据库把他的信息等 显示在网页里 openid 是唯一的 那么通过什么把联系起来呢 新手求解答 拜谢了

思路:获取微信用户的openid后去查询匹配数据库里的openid,如果存在就根据对应openid找出用户资料即可。
如何获取微信用户的openid你应该会写的了吧,既然你能写到数据库里,这个获取理所当然会用的,就省略了。

认证公众号才有权限申请接口去通过openid获取用户信息,

你说的这个可以通过oauth来获取用户openid.

第二种:发送一个带有加密openid参数的链接给用户。

笨死了你 ..

或者说你太懒了

http://mp.weixin.qq.com/wiki/2/5baf56ce4947d35003b86a9805634b1e.html

http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html

https://res.wx.qq.com/open/js/jweixin-1.0.0.js

这个要认证的服务号才可以的,oahth2.0授权就可以做到
http://www.cnblogs.com/txw1958/p/weixin71-oauth20.html
跟着这个做就OK了,我就是在这里学的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!