Can I obtain the QQ number through openId? I have successfully obtained the QQ openId in PHP. can I obtain the QQ number through openId? If yes, how can I obtain it?
Reply to discussion (solution)
No, I didn't find this interface.
Like the platform, you can only get nickname pictures and other general user information, such as high-density information such as QQ numbers, which you cannot find, but there are alternative methods.
Take the public platform as an account to follow a public account. its openID is unique for this public account. if you want to distinguish users from this openId
After obtaining QQ information through js, I submitted it to the background for registration using the following code
// You can call your own save interface here
$. Post ("/api_QQ.php ",{
Login_account: openId,
Nickname: reqData. nickname,
Act: 'login ',
Rand: Math. random ()
}, Function (data ){
If (data. status. code = '1 ')
{
Window. location. reload ();
}
}, "Json ");
The api_QQ.php code is as follows: I am careful that someone else directly simulates POST data and directly enters the api_QQ.php registration. how can I prevent it?
If ($ action = 'login ')
{
If (isset ($ _ SERVER ["HTTP_X_REQUESTED_WITH"]) & strtolower ($ _ SERVER ["HTTP_X_REQUESTED_WITH"]) = "xmlhttprequest ")
{
$ Login_account = isset ($ _ POST ['login _ account'])? Trim ($ _ POST ['login _ account']): '';
$ Real_name = isset ($ _ POST ['nickname'])? Trim ($ _ POST ['nickname']): '';
$ Ajax = array ();
If ($ user-> check_user ($ login_account )! = False)
{
// Directly log on if you have registered
...... Omitted
}
Else
{
// Register and log on directly if not registered
...... Omitted
}
$ Ajax ['status'] ['code'] = '1'; // success
Echo json_encode ($ ajax );
Exit;
}
}
There should be no public API for the QQ number.