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.
在我的购物中,我使用会话来存储用户的产品。但是,在用户在刷新时添加一个项目后,它正在添加另一个项目。所以我想知道是否有办法将 url 从 cart.php?actionaddid=1 删除到 cart.php。在这种情况下,不应再添加数量。
您可以header('Location: /path/to/cart.php'); exit;在完成将商品添加到购物车和可能的数据库后添加来执行此操作。这会将用户重定向到“cart.php”文件并删除查询字符串。
header('Location: /path/to/cart.php'); exit;