<?php 
    $app_id = "876605416349.apps.googleusercontent.com";
    $app_secret = "ixNDp9/inNE9+fZDLVjy98zr";
    $my_url = "http://www.btbsro.sk/web/confirmlogin_google_member.php";


    if(empty($code)) {
        $dialog_url = "https://accounts.google.com/o/oauth2/auth?client_id=".$app_id."&redirect_uri=".urlencode($my_url)."&scope=https://www-opensocial.googleusercontent.com/api/people&response_type=code";

        echo("<script> top.location.href='" . $dialog_url . "'</script>");
    }
    
    $code = $_REQUEST["code"];
?>