超碰中文网,91久久精品日日躁夜夜躁欧美,一区二区三区精品道,一区二区国产在线观看,亚洲精品中文字幕乱码一区二区,天天看片高清影视在线观看,久久99精品久久久久蜜桃,久久成人影视

VPS參考測評推薦
專注分享VPS主機優(yōu)惠信息
衡天云優(yōu)惠活動
熱網(wǎng)互聯(lián)2026年促銷活動
hostkvm優(yōu)惠促銷活動
zji優(yōu)惠促銷活動
QQGNET優(yōu)惠促銷活動
QQGNET優(yōu)惠促銷活動

phpcms中如何實現(xiàn)微信登錄(php微信登錄流程)

主機參考:VPS測評參考推薦/專注分享VPS服務(wù)器優(yōu)惠信息!若您是商家可以在本站進(jìn)行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務(wù),查看詳情!
我們發(fā)布的部分優(yōu)惠活動文章可能存在時效性,購買時建議在本站搜索商家名稱可查看相關(guān)文章充分了解該商家!若非中文頁面可使用Edge瀏覽器同步翻譯!PayPal代付/收錄合作

文章目錄

本教程系統(tǒng)要求:Windows 10系統(tǒng),phpcms v9版本,DELL G3電腦

如何使用phpcms實現(xiàn)微信登錄? >phpcms實現(xiàn)微信登錄(無需注冊,直接充值)

思路:回調(diào)參數(shù),直接注冊 (代碼不太規(guī)范,我自己整理一下)

在根目錄下新建一個目錄wechat.php。

訪問http://www.xxxxxx.cn/wechat.php。

注意回調(diào)地址。

phpcms實現(xiàn)微信登錄(無需注冊,直接充值)

wechat.php

在\phpcms\modules\member\index.php下添加

注意:輸出注冊狀態(tài)$status 可以返回錯誤信息。

電子郵件地址是必填字段,因此只需添加它。

error('身份驗證失敗'); ://api. weixin.qq.com/sns/oauth2/access_token?appid='.$appid.'&secret='.$appsecret.'&code='.$code.'&gr ant_type=authorization_code'; $token = json_decode(file_get_contents($ token_url)); if (isset($token->errcode)) { showmessage(L('

錯誤消息:

'.$token->errmsg) , HTTP_REFERER); 退出; 'https://api.weixin.qq.com/sns/oauth2/refresh_token?appid='.$appid.'&grant_type=refresh_token&refresh_token='.$token->刷新令牌; //轉(zhuǎn)換為對象 $access_token = json_decode(file_get_contents($access_token_url)); if (isset($access_token->errcode)) { showmessage(L('

Error 錯誤消息:

'.$access_token->errmsg), HTTP_REFERER); openid='.$access_token->openid.'&lang=zh_CN'; //轉(zhuǎn)換為對象 $user_info = json_decode(file_get_contents($user_info_url)); if (isset($user_info->errcode)) { show message(L( '

錯誤消息:

'.$user_info->errmsg), HTTP_REFERER); $rs = json_decode(json_encode($user_info),true);// 轉(zhuǎn)換為數(shù)組。?????????????????????????????????????????????????????????????????????????????????????????????????????--------用戶信息代碼獲取完成------------*/ header("Cache-control: private"); $checkname = trim($rs['nickname']); . "_".substr(md5($rs['unionid']),0,5); $this->_init_phpss o (); $cstatus = $this->client->PS_Checkname($Checkname); if($cstatus == -4 || $cstatus == -1) { $username = $rs['nickname']."_".substr(md5( $rs['unionid']),0, 5) ;????????? $密碼 = substr(md5($rs['unionid']),0,10); s_password($_POST['密碼']) && is_badword($_POST['password'])==false ? trim($_POST['password']) : showmessage(L('password_format_in Correct'), $cookietime = int Val ($ _ Post ['Cookietime') ]);_config('系統(tǒng)', 'phpsso')) { $this->_init_phpsso();???????????????????????????????????????????????????????????????????????? 他 -> 客戶端 -> ps_member_login($username, $password); if(isset($memberinfo['uid'])) $r = $this->db->get_one(array('phpssouid'= > $memberinfo['uid'])); if(!$r) { // 插入會員詳細(xì)信息。 不要插入成員 存在 'phpssouid'=>$memberinfo['uid'], 'usern ame'=>$memberinfo['username'], 'password'=>$memberinfo['password'], ' encrypt'=> $memberinfo['隨機'], ? ? ? ? ? ? ? ?'email'=>$memberinfo['email'], 'regip'=>$memberi nfo['regip'], 'lastip'=>$memberinfo['lastip'], 'lastda te'=>$memberinfo[' lastdate'], 'groupid'=>$this->_get_usergroup _bypoint(), // 成員的默認(rèn)組 SSION['connectid'])) { ;????????????????????????????? ;$userinfo['from'] = $userinfo['from'] 取消設(shè)置($_SESSION['connectid'], $_SESSION['from']); $this->db->insert($info); pssouid'=>$memberinfo['uid'])); $synloginstr = $this->client->ps_member_synlogin($r['phpssouid']); } Else {if ($ Status == -1) { // 用戶在 showMessag 中不存在 e(L('user_not_exist'), '/login.html');????????????????????????????????????????????????????????????????????????? ? ? ? ? ? ? ? ? ? ? showmessage(L('password_error'), '/login.html');showmessage(L('login_failure'), '/login.html'); ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ::load_model('times_model');?????????????????????? $rtime = $this->times_db->get_one(array('username'=> $username)); if($rtime['times'] > 4) { $分鐘 = 60 - 樓層((SY S_TIME - $rtime['登錄時間']) / 60); showmessage(L('wait_1_hour', array('minu te'=>$ 分鐘))); ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ray('用戶名'=>$用戶名)); If(!$r) showmessage(L('user_not_exist'),'/login.html' );if ($r['password']!=$password) {$ip = ip() if($rtime && $rtime['times'] times_db->update(array('ip'=>$ip, ' times'=>'+ =1'), array('用戶名'=>$用戶名)) >times_db->insert(array('用戶名'=>$用戶名, 'ip'=>$ip, 'logintime'=>SYS_TIME, 'times'=>1)); ssword_error', array('times'=>$times)), '/login.html', 3000); this->times_db->delete(array('username'=>$username)); If($r['islock']) { showmessage(L('user_is_lock'));$userid = $r['userid']; $group ID = $r['group ID']; $username = $r['username']; $nickname = 空($r['nickname']) ?用戶名 : $r['昵稱'];???????? $upda Tea = array('lastip'=>ip(), 'lastdate'=>SYS_TIME); 使用 R ['overdueDate'] = 0 && !in_array($r['groupid'], array('1', '7', '8')) && 空($r[vip])) { $grouplist = getcache('組列表'); !empty($grouplist[$r['groupid']][ 'allowupgrade'])) { $check_groupid = $this->_get_usergroup_bypoint($r['點']; if ($check_groupid!= $r['組ID']) {$updatearr['組ID'] = $groupid = $check_groupid;//對于已連接的用戶 if(!empty($_SESSION['connectid'])) { nnectid'] = $_SESSION['connectid']; $updatearr['from'] = $_SESSION['from'], $_SESSION['from']); $this->db->update($updatearr, array('userid'=>$userid) )); If(!isset($cookietime)) { $get_cookietime = param::get_cookie('cookietime') ; et_cookietime : 0); $cookietime = $_cookietime ? SYS_TIME + $_cookietime : 0 $phpcms_auth = sys_auth($userid."\t".$password, 'ENCODE', get_auth_key('login'));am::set_cookie('auth', $phpcms_auth, $cookietime); param::set_cookie('_userid', $userid, $cookietime); param::set_cookie('_username', $username, $cookietime); :set_cookie('_groupid', $groupid, $cookietime); 參數(shù)::set_cookie('_nickname' , $nickname, $cookietime); //print_r($_COOKIE); //退出; //param ::set_cookie('cookietime', $_cookietime, $cookietime); 使用 - '】? urldecode($_ POST['forward']): 'index.php?m=member&c=index';]."&username=".$_COOKIE[ 'vuGYB__usernamee']."&userid=".$_COOKIE['vuGYB__userid']."&groupid=".$_COOKIE['vuGYB__groupid']; header("local:".$url."");} // 用戶注冊 If $useInfo = Array (); $userinfo['加密'] = create_randomstr(6);????????? $userinfo['用戶名'] = $rs['昵稱']."_".substr(md5($rs['unionid']),0,5); _".substr(md5($rs['unionid']),0,5); $userinfo['email'] = time().' @yangpeili.com'; $userinfo['modelid'] = isset($_POST['modelid']) : 10 ] = $member_setting['默認(rèn)點int'] ? $member_setting['默認(rèn)點'] : 0; ['最后日期'] = SYS_TIME; $userinfo['connectid'] = iss et($_SESSION [' connectid']) ? $_SESSION['連接 ID'] : ''; $userinfo['from'] = isset($_SES SION['from']) ? $_SESSION['from']: ''; if($member_setting['choosemodel']) { require_once CACHE_MODEL_PATH.'member_input.cl ass.php'; require_once CACHE_MODEL_PATH.'member_update.class.php'; member_input($userinfo['modelid']); $_POST['信息'] = 數(shù)組映射('new_html_special_chars',$_POST['info']); POST['信息']); 圖('系統(tǒng)', 'phpsso')) { $this->_init_phpsso();???????????????????????????????????????????????????????????????????????? 客戶端->ps_member_register($userinfo['用戶名'], $userinfo['密碼'], $userinfo['email'], $userinfo['regip'], $userinfo['加密']); if($status > 0) { $userinfo['phpssouid'] = $狀態(tài);???????????????????????????????????????????????????????????????????????????????????????????????????????????? $userinfo['phpssouid'] cms_v9 $password d'] = 密碼($userinfo['密碼'], $userinfo['加密']);db->insert($userinfo, 1); If($member_setting['choosemodel']) { //如果選擇模型在 $user_model_info['userid'] = $userid; $this->db->set_model($userinfo['modelid']); sert($user_model_info); $_cookietime = $cookietime intval($cookietime) : ($get_cookietime ? $get_cookietime : 0); $cookietime = $_cookietime ? TIME + $_cookietime : 0; IF ($ Userinfo ['GROUPID'] == 7)_cookie('_username', $userinfo['用戶名'], $cookietime); param::set_cookie('email', $userinfo['email'], $cookietime); ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? word'], 'ENCODE', get_auth_key('login')); 'groupid'=> "6"), array('userid'=>$userid)); ber` SET `groupid`='6' WHERE ` userid` = $userid ";//更改用戶級別為注冊用戶 mysql_query($sql); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 參數(shù)::set_cookie('_userid', $userid, $cookietime);param::set_cookie('_username', $userinfo['username'], $cookietime); param::set_cookie('_groupid', $userinfo['groupid'], $cookietime); param::set_cookie('cookietime', $_cookietime, $cookietime); ? ? ? ? ? ? ? ? $forward = isset($_POST['forward']) && !empty($_POST['forward']) ? ]) : 'index.php?m=member&c=index'; //https 和 http 域間傳遞用戶名 跳轉(zhuǎn)至cookie $url = "http://www.zhiliaoke.com.cn/set_cookie_www.php?nickname=".$_COOKIE['vuGYB__nickname']."&username=" .$ _COOKIE['vuGYB__username' ]."&userid=".$_COOKIE['vuGYB__userid']."&groupid=".$_COOKIE['vuGYB__groupid']; header("位置:".$url.""); Showmessage(L('enable_register').L('enable_phpsso'), '/login.html'); showmessage(L('operation_failed'), HTTP_REFERER); }?>

添加最后一步馬蘇。

這非常重要,但最容易被忽視。 ! !

有人被困在這里。

在phpcms\modules\member\classes\foreground.class.php文件第21行左右,我們需要檢查用戶是否通過微信功能登錄。

歡迎來到PHP中文網(wǎng),有很多免費的PHPCMS教程和在線學(xué)習(xí)

下載微信小程序

微信是一款支持發(fā)送語音消息的手機通訊軟件! 、視頻、照片和文本。 微信支持個人聊天和群聊,您還可以根據(jù)您的地理位置找到附近的人,給您帶來全新的移動通訊體驗。 有需要的朋友,請快來保存您的下載體驗吧!

下載!

這幾篇文章你可能也喜歡:

本文由主機參考刊發(fā),轉(zhuǎn)載請注明:phpcms中如何實現(xiàn)微信登錄(php微信登錄流程) http://www.k2270.com/140264.html

【騰訊云】領(lǐng)8888元采購禮包,搶爆款云服務(wù)器 每月 9元起,個人開發(fā)者加享折上折!
打賞
轉(zhuǎn)載請注明原文鏈接:主機參考 » phpcms中如何實現(xiàn)微信登錄(php微信登錄流程)
主機參考僅做資料收集,不對商家任何信息及交易做信用擔(dān)保,購買前請注意風(fēng)險,有交易糾紛請自行解決!請查閱:特別聲明

評論 搶沙發(fā)

評論前必須登錄!