开发者

How to know the page that is came from brower history or not

I created a html page(page1). This page contain a link and a submit button. If the link is clicked, the another html page(page2) is reached. If the submit button is clicked, this page is post back to server and go to another html page(page2). If the user is clicked the back button of开发者_如何学C browser in page2, the page1 will be shown. So, the user can click submit button next time. I do not like this. So, I want to check page1 that is came from browser history or not. Can I get it.


You can always check the referrer. I don't know what your server is using, so I can't tell you how to do this. However you should know that it is possible to fake a referrer, so this isn't exactly fool-proof.


One way I could do is include the time the page was generated on the page and then use some Javascript to compare the local time while the page was generated. If time is different by a threshold, the site has been in a cache. The problem with this is if the client computer has a time set incorrectly, but you can avoid this by having the client include the current system in order to generate the page and send that value to the customer.


okka sari oongo sari potundi it will come soon as early as posible to make it

pleaase okkasari ooongo ra poooka

saripotundi

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜