图片一直重定向到允许url,但我希望它留在页面选项卡中查看图片


The image keeps redirecting to allow url but I want it to stay in the page tab to see the image

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

<?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";
}
?>

从你的问题中的简短代码来看,我看不出你在哪里检查用户是否对你的应用程序进行了授权,甚至看不出是否有人登录你的应用。你可能想开始使用Facebook PHP SDK(https://developers.facebook.com/docs/reference/php/)用于对用户进行身份验证,以便跟踪他们。

相关文章: