Answer the question
In order to leave comments, you need to log in
Why can't get a token?
I do authorization on the site through VK, I can’t get a token, it is not displayed.
Here is the page with the login button:
<?php
include 'config.php';
?>
<p><a href="https://oauth.vk.com/authorize?client_id=<?=ID?>&display=page&redirect_uri=<?=URL?>&response_type=code&v=5.52" target="_blank">Войти через ВК</a></p>
<?php
if (!isset($_GET['code'])) {
exit('Error');
}
include 'config.php';
$token = json_decode(file_get_contents('https://oauth.vk.com/access_token?client_id='.ID.'&redirect_uri='.URL.'&client_secret='.SECRET.'&response_type=code&v=5.52'.$_GET['code']), true);
print_r($token);
?>
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