if($_GET['code']) { $json = @file_get_contents("https://oauth.vk.com/access_token?client_id=$api_id&client_secret=$secret_key&code={$_GET['code']}&redirect_uri=$redirect_uri"); $json_obj = json_decode($json); if($json) { if($json_obj->user_id and $json_obj->access_token) { users::create(array( 'vk_id' => $json_obj->user_id, 'ip_address' => ip_address(), 'date_reg' => full_date(), 'time_reg' => time(), 'group' => 1, 'points' => 300, 'hash' => hash('ripemd160', time()) )); header('Location: /'); } } }
Strange. But nowhere redirects.
if($json_obj->user_id and $json_obj->access_token) {
condition is triggered. If instead of header () put echo 1 ;, then it displays .. Proved header ('Location: /'); exit; but also does not redirect anywhere. What could be the problem?