图像保持重定向以允许URL,但我希望它保留在页面选项卡中以查看图像

时间:2012-02-01 07:10:47

标签: php html facebook

我手头有一个令人沮丧的问题。我的页面选项卡应用程序需要一个图像。当我点击页面标签中的图片时,我希望它检查我的帐户之前是否使用过该应用程序。现在,我在代码中有一个图像,但它没有显示出来,而是重定向到应用程序。我该如何解决?

<?php
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
include_once "config.php";
session_start();
if (!isset($_SESSION["visited"]))
{
    $_SESSION["visited"] = "yes";
?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
</head>
<body>
<center>
    <script type="text/javascript" language="javascript">
        function doReload() {
            top.location.href = "<?=$allow_url?>";
        }
    </script>
    <span id="continue" onclick="doReload()"><img src="photos/astronaut.png" alt=""/></span>
</center>
</body>
</html>
<?
}
else
{
    include_once "fbmain.php";
    include_once "mysqli.connect.php";
    include_once "fancybox.inc";
}
?>

1 个答案:

答案 0 :(得分:0)

从你问题中的一小段代码中,我看不到你在哪里检查用户是否已经为你的应用程序授权,或者即使你的应用程序有任何登录信息。您可能希望开始使用Facebook PHP SDK(https://developers.facebook.com/docs/reference/php/)对用户进行身份验证,以便跟踪它们。