当我点击浏览器的后退按钮时,如何在主页上重定向

时间:2022-06-25 21:15:40

i have ecommerce website in which we use shopping cart page when any person purchase product and paid the payment then we have thank you page,

我有电子商务网站,当我们使用购物车页面任何人购买产品并付款时,我们感谢你页面,

home page => products => shopping cart => proceed payment => thank you

首页=>产品=>购物车=>继续付款=>谢谢

now when i click on the browser's back button it is going in proceed payment page and give a errors of session.

现在,当我点击浏览器的后退按钮时,它将进入付款页面并提供会话错误。

i want to go back on home page when i click on browser's back button in thank you page.

当我在感谢页面点击浏览器的后退按钮时,我想回到主页。

proceed payment => thank you => home page.

继续付款=>谢谢=>主页。

1 个解决方案

#1


1  

On the thank you page, set a flag in the session. On previous pages, check this flag. If it is set, send the user to the first page using header('Location: ...'); (don't forget to run exit; directly after the header line).

在感谢页面上,在会话中设置一个标志。在前几页中,选中此标志。如果已设置,请使用标题将用户发送到第一页('Location:...'); (不要忘记运行退出;直接在标题行之后)。

#1


1  

On the thank you page, set a flag in the session. On previous pages, check this flag. If it is set, send the user to the first page using header('Location: ...'); (don't forget to run exit; directly after the header line).

在感谢页面上,在会话中设置一个标志。在前几页中,选中此标志。如果已设置,请使用标题将用户发送到第一页('Location:...'); (不要忘记运行退出;直接在标题行之后)。