Restricting access to page unless coming from a specific page

后端 未结 5 1743
忘掉有多难
忘掉有多难 2021-01-22 12:27

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 y

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-22 12:55

    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 like:

    Go!
    

    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.

提交回复
热议问题