Необъяснимое происходит на последнем пункте, в котором я пытаюсь получить access_token через полученный code. Вот пример запроса, который выходит:
https://oauth.vk.com/access_token?client_id=CLIENTID?%D1%81lient_secret=CLIENTSECRET&code=fcc8e8abdc7a0500c9&redirect_uri=http://localhost/test/login.php
Вот код:
<?php
require_once("config.php");
if(empty($_GET['code'])) header("location:/test/index.php");
else
{
@$apitoken = File_Get_Contents("https://oauth.vk.com/access_token?client_id={$appid}?сlient_secret={$appkey}&code={$_GET['code']}&redirect_uri={$redirect_uri}");
$apitoken = json_decode($apitoken, true);
$_SESSION['apitoken'] = $apitoken['access_token'];
$_SESSION['user_id'] = $apitoken['user_id'];
header('location: /test/index.php');
}
?>
Что при работе кода, что вручную получаю одну и ту же ошибку:
{"error":"invalid_client","error_description":"client_secret is undefined"}
Я менял приложения, их типы. С десяток раз проверял истинность client_secret В чём дело?