Guest User

Untitled

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