pocobueno1388 Posted November 2, 2006 Share Posted November 2, 2006 Is there any way I can make it so when a user clicks the 'Back' button it won't refresh the page they are goign to?right now when I click the back button on my site it says "The page contains POSTDATA...click ok to resend the data". I know there is some way to get rid of this, but I can't seem to find it again. Link to comment https://forums.phpfreaks.com/topic/25925-making-the-back-buttion-not-refresh-data-solved/ Share on other sites More sharing options...
joshi_v Posted November 2, 2006 Share Posted November 2, 2006 If you are not printing any data to the browser you can use headers in php.[code]header("Location : filename");[/code]If you like to use javascript[code]window.location.href="filename with path";[/code]RegardsJoshi. Link to comment https://forums.phpfreaks.com/topic/25925-making-the-back-buttion-not-refresh-data-solved/#findComment-118392 Share on other sites More sharing options...
pocobueno1388 Posted November 2, 2006 Author Share Posted November 2, 2006 The problem with that is there is no one specific path.I am talking about the 'back' button on their browser. The one in the top left had corner to the left of the refresh button, lol.I just want it to go back to the last page they were at with out trying to refresh the data on the page. Link to comment https://forums.phpfreaks.com/topic/25925-making-the-back-buttion-not-refresh-data-solved/#findComment-118398 Share on other sites More sharing options...
tomfmason Posted November 2, 2006 Share Posted November 2, 2006 Well there are couple ways that I can think of that may help with this. Well a simple way is place this in the body tag<body onload="javascript:history.go(1);">This means if there is another entry after the current page in the history object then it will redirect them to that page. Now I am not sure if this will prevent the double posting..Give it a try..Good Luck,Tom Link to comment https://forums.phpfreaks.com/topic/25925-making-the-back-buttion-not-refresh-data-solved/#findComment-118408 Share on other sites More sharing options...
Psycho Posted November 2, 2006 Share Posted November 2, 2006 You need to include this header. This will direct the browser to display the page as it is stored in the browsers cache instead of trying to get the page from the server.header("Cache-control: private"); Link to comment https://forums.phpfreaks.com/topic/25925-making-the-back-buttion-not-refresh-data-solved/#findComment-118428 Share on other sites More sharing options...
pocobueno1388 Posted November 2, 2006 Author Share Posted November 2, 2006 Thats exaclty what I was looking for mjdamato. Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/25925-making-the-back-buttion-not-refresh-data-solved/#findComment-118714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.