0

fancybox 的这个问题让我抓狂。当您单击该链接时,加载图标会一直显示,并且不会显示任何页面。我已经测试了几件事,但我不知道为什么会发生这种情况。

它只发生在一种特定类型的页面上,它是我用来向 facebook 注册用户的页面(我在内部使用 hybridauth)。他们应该被要求在 facebook 网站上获得授权,但什么都没有。但是当然,如​​果你正常打开链接,没有fancybox,它就可以正常工作。

我为这个问题做了一个活生生的例子,所以你可以自由地探索它。 现场测试

我非常感谢您的帮助,如果您需要更多信息,请询问。谢谢你。

编辑:这是 register.php 源代码:

<?php
session_start();

error_reporting(E_ALL);
ini_set('display_errors', 'On');

$config = dirname(__FILE__) . '/hybridauth/hybridauth/Hybrid/config.php';
require_once( "hybridauth/hybridauth/Hybrid/Auth.php" );

try{
    $hybridauth = new Hybrid_Auth( $config );

    switch($_GET["s"]){

        case "facebook":
            $facebook = $hybridauth->authenticate( "Facebook" );
            $facebook_user_profile = $facebook->getUserProfile();

            echo "<pre>";
            print_r( $facebook_user_profile );
            echo "</pre>";
    }

} catch(Exception $e){
    // Display the recived error,
    // to know more please refer to Exceptions handling section on the userguide
    switch( $e->getCode() ){
        case 0 : echo "Unspecified error."; break;
        case 1 : echo "Hybriauth configuration error."; break;
        case 2 : echo "Provider not properly configured."; break;
        case 3 : echo "Unknown or disabled provider."; break;
        case 4 : echo "Missing provider application credentials."; break;
        case 5 : echo "Authentification failed. "
        . "The user has canceled the authentication or the provider refused the connection.";
        break;
        case 6 : echo "User profile request failed. Most likely the user is not connected "
        . "to the provider and he should authenticate again.";
        $twitter->logout();
        break;
        case 7 : echo "User not connected to the provider.";
        $twitter->logout();
        break;
        case 8 : echo "Provider does not support this feature."; break;
    }

    // well, basically your should not display this to the end user, just give him a hint and move on..
    echo "<br /><br /><b>Original error message:</b> " . $e->getMessage();
}
4

2 回答 2

0

您的 register.php 正在返回:

http://www.andsheep.com/dev/tests/live/BS_tests/hybridauth/hybridauth/?hauth.start=Facebook&hauth.time=1352910122&r=

你也有:dirname(__FILE__)在一条线上,但不是另一条线。

$config = dirname(__FILE__) . '/hybridauth/hybridauth/Hybrid/config.php';
require_once( "hybridauth/hybridauth/Hybrid/Auth.php" );

无论如何,现在我在 facebook 链接上获得了一个 .htpasswd 登录框......

于 2012-11-14T16:31:08.923 回答
0

我认为问题可能是 Facebook 阻止了 iframe 的身份验证对话框。

于 2012-11-15T10:23:21.863 回答