Created
September 9, 2012 16:59
-
-
Save krll-k/3685660 to your computer and use it in GitHub Desktop.
Авторизация и получение прав
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*Авторизация и получение прав | |
*/ | |
function first_function() { | |
$authorize = 'http://oauth.vk.com/authorize?'.http_build_query(array( | |
'client_id' => $api_id, | |
'scope' => $scope, | |
'display' => $display, | |
'redirect_uri' => $redirect_uri)); | |
function second_function() { | |
$access_get = 'https://oauth.vk.com/access_token?'.http_build_query(array( | |
'client_id' => $api_id, | |
'client_secret' => $secret_key, | |
'redirect_uri' => $display, | |
'code' => $_REQUEST['code'])); | |
} | |
if (count($_REQUEST['code'])==NULL){ | |
header("Location:".$authorize);} | |
else{ | |
$access_get = file_get_contents($access_get); | |
print_r($access_get); | |
} | |
$access_get = json_decode($access_get); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*Авторизация и получение прав | |
*/ | |
$authorize = 'http://oauth.vk.com/authorize?'.http_build_query(array( | |
'client_id' => $api_id, | |
'scope' => $scope, | |
'display' => $display, | |
'redirect_uri' => $redirect_uri)); | |
$access_get = 'https://oauth.vk.com/access_token?'.http_build_query(array( | |
'client_id' => $api_id, | |
'client_secret' => $secret_key, | |
'redirect_uri' => $display, | |
'code' => $_REQUEST['code'])); | |
if (count($_REQUEST['code'])==NULL){ | |
header("Location:".$authorize);} | |
else{ | |
$access_get = file_get_contents($access_get); | |
print_r($access_get); | |
} | |
$access_get = json_decode($access_get); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment