<?php 


    require_once('konfigurace.php');

    $sql = mysql_query("SELECT * FROM forum_konfigurace WHERE ID = '1';");
    $data = mysql_fetch_array($sql);
    $app_id =$data["FB_AppID"];
    $app_secret =$data["FB_AppSecret"];
    
    $my_url = "http://www.btbsro.sk/web/confirmlogin_fb_member.php";
  
  echo"";
    if(empty($code)) {
        $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" 
            . $app_id . "&redirect_uri=" . urlencode($my_url)."&scope=email";

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