Php 为什么fancybox没有加载我的页面?
fancybox的这个问题快把我逼疯了。单击链接时,加载图标将永远显示,并且不会显示任何页面。我已经测试了一些东西,但我不知道为什么会发生这种情况 它只发生在特定类型的页面上,我使用它向facebook注册用户(我在内部使用hybridauth)。他们应该在facebook网站上获得授权,但是什么都没有。但是当然,如果你正常打开链接,没有fancybox,它就可以正常工作 我为这个问题做了一个活生生的例子,这样你就可以自由地探索它了。 我真的很感谢你的帮助,如果你需要更多的信息,尽管问吧。 多谢各位 编辑: 下面是register.php源代码:Php 为什么fancybox没有加载我的页面?,php,javascript,jquery,fancybox,hybridauth,Php,Javascript,Jquery,Fancybox,Hybridauth,fancybox的这个问题快把我逼疯了。单击链接时,加载图标将永远显示,并且不会显示任何页面。我已经测试了一些东西,但我不知道为什么会发生这种情况 它只发生在特定类型的页面上,我使用它向facebook注册用户(我在内部使用hybridauth)。他们应该在facebook网站上获得授权,但是什么都没有。但是当然,如果你正常打开链接,没有fancybox,它就可以正常工作 我为这个问题做了一个活生生的例子,这样你就可以自由地探索它了。 我真的很感谢你的帮助,如果你需要更多的信息,尽管问吧。 多
<?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();
}
您的register.php正在返回:
您还可以在一行中使用:dirname(\uu\u文件)
,但在另一行中没有
无论如何,现在我在facebook链接上得到了一个.htpasswd登录框…我想问题可能是facebook阻止了iFrame的身份验证对话框。它的bandsheep.com
不是和sheep.com
对吗?您正在尝试加载和sheep.com
。检查导致重定向的facebook设置。如果您发布register.php的php代码以查看$\u GET['s']
之后的操作,这将非常有用。。。还有你的.htaccess
的相关部分,因为当你通过?s=facebook
(http://bandsheep.com/sof/register.php?s=test
不返回任何内容(例如)由于我的错误,我修复了URL重定向问题。
$config = dirname(__FILE__) . '/hybridauth/hybridauth/Hybrid/config.php';
require_once( "hybridauth/hybridauth/Hybrid/Auth.php" );