This article mainly shows you the "php version of Wechat public platform Wechat web login authorization example analysis", the content is easy to understand, well-organized, I hope to help you resolve your doubts, the following let the editor lead you to study and study "the php version of Wechat public platform Wechat web login authorization example analysis" of this article.
The details are as follows:
Wechat public platform to achieve Wechat web page login authorization development is actually very simple, because the official reference program, the following editor looked at a webmaster according to the official reference to do a web page login authorization example, you can take a look.
/ / replace it with your own interface information $appid = 'XXXXX';header (' location: https://open.weixin.qq.com/connect/oauth3/authorize?appid='.$appid.'&redirect_uri=127.0.0.1/oauth.php&response_type=code&scope=snsapi_userinfo&state=123&connect_redirect=1#wechat_redirect'); Whether the parameter must indicate that appid is the unique identification of the official account. Redirect_uri is the callback link address redirected after authorization. Use urlencode to process the link. Response_type is the return type. Enter codescope as the application authorization scope, snsapi_base (do not pop up the authorization page, jump directly, and only get the user openid), snsapi_userinfo (pop-up authorization page, you can get nickname, gender and location through openid. And, even if the user is not concerned, as long as the user is authorized to obtain its information) whether the state will be redirected with the state parameter, developers can fill in the parameter value of a-zA-Z0-9 # wechat_redirect must take this parameter whether it is opened directly or redirected to the page
File 2: oauth.php, the code is as follows:
Parameter describes the gender of the openid user's unique identifier, nickname user nickname, sex user. A value of 1 is male, a value of 2 is female, and a value of 0 is the city or country where the personal data of an unknown province user is filled in by the province city ordinary user. For example, China is the profile picture of the CNheadimgurl user. The last value represents the size of the square avatar (there are 0, 46, 64, 96, 132 values optional, 0 means 640 square avatar). This item is empty if the user does not have an avatar. This field is empty if the user does not have an avatar. This field appears only after the user binds the official account to the open platform account of Wechat for (chinaunicom) unionid, such as Wechat Woka user (chinaunicom). For more information, please see: obtaining users' personal Information (UnionID mechanism). These are all the contents of this article entitled "sample Analysis of Wechat Web access Authorization on the php version of Wechat Public platform". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
This article mainly introduces the basic functions of hotel reservation Mini Program development, the article is very detailed, has a certain reference value, interested friends must read it! First, the development of hotel reservation Mini Program makes hotel reservation more convenient why hotel reservation Mini Program has a bearing on the development of the current industry
This article mainly introduces the relevant knowledge of "how to configure speed limit and current limit with built-in module in nginx". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to configure speed limit and current limit with built-in module in nginx" can help you understand.
This article introduces the relevant knowledge of "how to understand AJAX development technology". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something! AJAX (As
This article mainly explains "how to use the Laravel queue". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use the Laravel queue. Under what circumstances do you use queues? Time-consuming
Editor to share with you how css calls class, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it! In css, you can take advantage of ".class"