For the function introduction of wechat scanning code login to the website, please read the official document [wechat Login Development Guide for Website Application]. The following uses PHP code to realize wechat scanning code login to the website (take Yidian in the official document as an example) :

<? php header("Content-type:text/html; charset=utf-8"); $appID = 'wXBdC5610CC59c1631 '; / / application AppID $redirect_uri = 'https://passport.yhd.com/wechat/login.do'; $redirect_uri = urlenCode ($redirect_uri); // start session session_start(); $state = MD5 (uniqid(rand(), TRUE)); $_SESSION["wx_state"] = $state; // Splice url $wxlogin_URL = "https://open.weixin.qq.com/connect/qrconnect?appid=".$appid."&redirect_uri={$redirect_uri}&response_type=code&scope=sns api_login&state={$state}#wechat_redirect"; Header ("Location: $wxlogin_URL ");Copy the code

Browser access PHP program, jump to wechat scan code login page as shown below:

To achieve the jump to the wechat scan code login site function. If you feel that the scan code style of the big black screen is not very nice, you can choose another scan code login method: embedded JS wechat scan code login and custom style