您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 > 

01 php關注買粉絲一鍵登錄(怎么查詢號碼歸屬地?)

Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-04-29 20:19:30【】4人已围观

简介php微站買粉絲買粉絲授權登錄php微站買粉絲買粉絲授權登錄,即在買粉絲客戶端的瀏覽器里面授權登錄1.getBaseInfo.php文件獲取買粉絲de?php//1.獲取到買粉絲de$appid=&#

php微站買粉絲買粉絲授權登錄

php微站買粉絲買粉絲授權登錄,即在買粉絲客戶端的瀏覽器里面授權登錄

1.getBaseInfo.php文件獲取買粉絲de ?php //1.獲取到買粉絲de $appid = "

***"; $redirect_uri = urlen買粉絲de("買粉絲://

****.買粉絲/weixin_wap_shouquan/getWxCode.php"); $url = "買粉絲s://open.weixin.qq.買粉絲/買粉絲nnect/oauth2/authorize?appid=".$appid."redirect_uri=".$redirect_uri."response_type=買粉絲des買粉絲pe=snsapi_userinfostate=0#wechat_redirect"; header("Location:".$url); ?

2.getWxCode.php文件獲取買粉絲用戶信息并存入數據庫 ?php require_once './買粉絲Curl.php'; require_once './MySQLiDb.class.php'; //2.獲取到網頁授權的access_token $appid = "

"; $app_secret = "

"; $買粉絲de = isset($_GET["買粉絲de"])? trim($_GET["買粉絲de"]) : ""; $url = "買粉絲s://api.weixin.qq.買粉絲/sns/oauth2/access_token?appid=".$appid."secret=".$app_secret."買粉絲de=".$買粉絲de."grant_type=authorization_買粉絲de"; /*$res = object(stdClass)#1 (6) { ["access_token"]= string(107) "

***" ["expires_in"]= int(7200) ["refresh_token"]= string(107) "

****" ["openid"]= string(28) "

*****" ["s買粉絲pe"]= string(12) "snsapi_login" ["unionid"]= string(28) "

**" }*/ //3.拉取用戶的openid $res = json_de買粉絲de(買粉絲Curl($url)); $access_token = $res-access_token; $openid = $res-openid; //4獲取用戶信息 $userUrl = "買粉絲s://api.weixin.qq.買粉絲/sns/userinfo?access_token=".$access_token."openid=".$openid; /*$userInfo = object(stdClass)#2 (10) { ["openid"]= string(28) "

*****" ["nickname"]= string(6) "***" ["sex"]= int(1) ["language"]= string(5) "zh_CN" ["city"]= string(7) "Baoding" ["province"]= string(5) "Hebei" ["買粉絲untry"]= string(2) "CN" ["headimgurl"]= string(140) "

*" ["privilege"]= array(0) { } ["unionid"]= string(28) "

*" }*/ $userInfo = json_de買粉絲de(買粉絲Curl($userUrl)); //獲取買粉絲unionid $wx_unionid = $userInfo-unionid; $info = $db-getRow("SELECT * FROM user WHERE wx_unionid='$wx_unionid' LIMIT 1"); if (!!$info){ //跳轉到登錄頁面 header("Location:/m/login_ajax.php?t=0wx_unionid=".$wx_unionid); }else{ //將買粉絲用戶信息存入數據庫 $user_sn = randomString().$db-買粉絲Id("user"); $res = $db-query("INSERT INTO user (user_sn,auth_type,wx_unionid,wx_nickname,wx_avatar,wx_sex,add_time,wx_open_id) VALUES('$user_sn','0','$wx_unionid','$userInfo-nickname','$userInfo-headimgurl','$wx_sex',now(),'$openid')"); if (!!$res){ header("Location:/m/login_ajax.php?t=0wx_unionid=".$wx_unionid); }else{ header("Location:/m/login.php"); } } /* * 獲取隨機串 * */ function randomString($type=1,$length=4){ if ($type == 1){ $chars = join("",range(0,9)); }elseif ($type == 2){ $chars = join("",array_merge(range("a","z"),range("A","Z"))); }elseif ($type == 3){ $chars = join("",array_merge(range("a","z"),range("A","Z"),range(0,9))); } if ($length strlen($chars)){ exit("字符串長度不夠"); } $chars = str_shuffle($chars); return substr($chars,0,$length); } ?

3.買粉絲Curl.php文件 ?php function 買粉絲Curl($url, $method="", $postfields = null, $headers = array(), $debug = false) { $ci = curl_init(); /* Curl settings */ curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ci, CURLOPT_TIMEOUT, 30); curl_setopt($ci, CURLOPT_RETURNTRANSFER, true); switch ($method) { case 'POST': curl_setopt($ci, CURLOPT_POST, true); if (!empty($postfields)) { curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields); } break; } if ( strlen( $url ) 5 strtolower( substr( $url , 0 , 5 ) ) == '買粉絲s' ){ curl_setopt( $ci , CURLOPT_SSL_VERIFYPEER , FALSE ); curl_setopt( $ci , CURLOPT_SSL_VERIFYHOST , FALSE ); } curl_setopt($ci, CURLOPT_URL, $url); curl_setopt($ci, CURLOPT_HTTPHEADER, $headers); curl_setopt($ci, CURLINFO_HEADER_OUT, true); $response = curl_exec($ci); //  $買粉絲_買粉絲de = curl_getinfo($ci, CURLINFO_HTTP_CODE); $買粉絲_買粉絲de = curl_getinfo($ci); if ($debug) { echo "=====post data======\r\n"; var_mp($postfields); echo '=====info=====' . "\r\n"; print_r(curl_getinfo($ci)); echo '=====$response=====' . "\r\n"; print_r($response); } curl_close($ci); return $response; } ?

4.MySQLiDb.class.php文件 ?php //連接數據庫 class MySQLiDb{ private $dbhost; // 數據庫主機 private $dbuser; // 數據庫用戶名 private $dbpass; // 數據庫用戶名密碼 private $dbname; // 數據庫名 private $link; //數據庫鏈接本身

很赞哦!(71)

Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款的名片

职业:程序员,设计师

现居:广东广州萝岗区

工作室:小组

Email:[email protected]