Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!$_GET['code']) { echo '<a href="https://oauth.vk.com/authorize?client_id=АЙДИ&scope=ПРАВА&redirect_uri=ВЕБ-АДРЕС ПОЛУЧАТЕЛЯ&display=page&response_type=code&v=5.21">'; }
- if($_GET['code']) {
- $jsonToken = curlGet("https://oauth.vk.com/access_token?client_id=АЙДИ&client_secret=СЕКРЕТ_ПРИЛОЖЕНИЯ&code=".$_GET['code']."&redirect_uri=ВЕБ-АДРЕС ПОЛУЧАТЕЛЯ");
- $decodedToken = json_decode($jsonToken);
- echo '<input type="text" name="token" size="90" value="'.$decodedToken->access_token.'">';
- echo '<div id="lifetime">Token lifetime: '.$decodedToken->expires_in.' seconds</div>';
- }
Advertisement
Add Comment
Please, Sign In to add comment