除非来自特定页面,否则限制对页面的访问 [英] Restricting access to page unless coming from a specific page

查看:77
本文介绍了除非来自特定页面,否则限制对页面的访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图弄清楚如何限制对页面的访问,除非页面从特定的门页面导航到。基本上我希望页面无法访问,除非你来自我的站点地图中的页面。我不确定这是否可能。如果可能的话,你能否限制你使用html或javascript的建议?

I'm trying to figure out how to restrict access to a page unless the page is navigated to from a specific "gate" page. Essentially I want the page to be unaccessible unless you're coming from the page that comes before it in my sitemap. I'm not certain this is even possible. If possible, can you limit your suggestions to using either html or javascript?

推荐答案

如果你加密了一个变量怎么办?日期)并将其放在门链接中。当您到达新页面时,脚本会对变量进行解密,如果它不匹配或者甚至不匹配,脚本会重定向到另一个页面。

What if you encrypted a variable (like the current date) and placed that in the "gate" link. When you arrive at the new page, a script decrypts the variable and if it doesn't match or isn't even there, the script redirects to another page.

Something喜欢:

Something like:

<a href="restricted.php?pass=eERadWRWE3ad=">Go!</a>

编辑:我不太清楚JS打印该代码但我知道几个库,可以为你做所有的加密/解密。

Edit: I don't know JS well enough to print that code but I know there are several libraries out there that can do all the encryption/decryption for you.

这篇关于除非来自特定页面,否则限制对页面的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆