Answer the question
In order to leave comments, you need to log in
What is the error when receiving a response from VK?
I set up authorization through VK. API request. The users.get method Nothing comes up
in response. Tell me, where did you go wrong?
Those. var_dump will show bool(false)
public function get_user(){
if(!$this->token){
exit("wrong code!");
}
if(!$this->uid){
exit("wrong code!");
}
$query2 = "?user_id=".$this->uid."&access_token=".$this->token;
$kur = curl_init();
curl_setopt($kur, CURLOPT_URL, URL_GET_USER.$query2);
curl_setopt($kur, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($kur, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($kur, CURLOPT_RETURNTRANSFER, TRUE);
$result2 = curl_exec($kur);
curl_close($kur);
var_dump($result2);
$_SESSION['vk_user'] = json_decode($result2);
//$this->redirect(PRIVATE_URL);
}
define("URL_GET_USER",'https://api.vk.com/method/users.get');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question