Código PHP:
Ver original
include("include/conneccionBD.php"); include("include/debugErrors.php"); require 'include/facebook/facebook.php'; if($suser=$_GET['suser']){ $_SESSION['suser']=$suser; }elseif(!$suser=$_SESSION['suser']){ $suser=""; } 'appId' => 'XXXXXXX', 'secret' => 'XXXXXXXXXXXXXXX', 'cookie' => true, )); $app_id = "XXXXXXX"; // CAMBIAR ESTA URL POR LA DEL TABS FINAL Y SUBIR AL HOST DE SECUAPPS $canvas_page="https://www.facebook.com/pages/XXXX/XXXXXXXXXXXXXX?id=XXXXXXX&sk=app_XXXXXXXXXXXXX"; $auth_url = "https://www.facebook.com/dialog/oauth?client_id=" $signed_request = $_REQUEST["signed_request"]; log_DF("PEDIR LOGIN","Starting"); log_DF("PEDIR LOGIN","$auth_url"); echo("<script> top.location.href='" . $auth_url . "'</script>"); } else { $user_profile = $facebook->api('/me'); log_DF("INICIO","Bienvenido : ".$user_profile['name']); $fql = "SELECT uid FROM page_fan WHERE page_id=121271114590540 and uid = me()"; 'method' => 'fql.query', 'query' =>$fql, )); log_DF("INICIO","DATA : ".$response[0]['uid']); if($response[0]['uid']==""){ log_DF("PEDIR LOGIN PERMISO","Starting"); log_DF("PEDIR LOGIN PERMISO","$auth_url"); } $fans=true; }else{ $fans=false; } if($fans){ log_DF("FANS",$fans); if($suser==""){ $sql="select id_usuario from usuarios where fbk='".$user_profile['id']."'"; log_DF("QUERY SELECT",$sql); $_SESSION['conscode']=$row['id_usuario']; log_DF("QUERY SELECT RESULT","==>".$row['id_usuario']); echo("<script> window.location.href='Ganaste.php?u=".$response[0]['uid'].";'</script>"); }else{ log_DF("QUERY SELECT RESULT","DATOS"); echo("<script> window.location.href='Participa.php';</script>"); } }else{ } }else{ } }
Si me pueden ayudar por favor, mil gracias