Prevent direct access of a fancybox iframe content

2019-08-20 09:41发布

Is there any solution that prevent an access to any content that is made to be called via fancybox iframe only?

I am using fancybox ver 2.0 and PHP as a server end programming.

Have a look for example.

<a href="feedback.php" class="feedback fancybox.iframe">Feedback</a>

Now generally when a user clicks on feedback link, fancybox will handle the request.

But I want to prevent users from accessing "feedback.php" page directly from the browser's address bar.

1条回答
等我变得足够好
2楼-- · 2019-08-20 10:14
if (!empty($_SERVER['HTTP_REFERER'])){
    header("Location: ".$_SERVER['HTTP_REFERER']);}
else {
   header("Location: index.php");
}
查看更多
登录 后发表回答