Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建一个网上商店。在 index.php 上,我有一个指向注册和登录表单的链接。当我将产品添加到我的购物车时,我会检查用户是否已经登录。如果没有,用户必须注册。如何使用相同的注册表单,并检查用户是来自页面购物车,还是来自索引(或其他页面)?
您可以为此使用 cookie。您需要存储 cookie,然后在重新访问登录页面时将其恢复。