SCook Posted August 7, 2007 Share Posted August 7, 2007 When I click the back button on a page generated by php, to go back to a listing page generated by php, I get this: Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. Does anyone know a way to prevent this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/63651-back-button-gives-an-expired-warning/ Share on other sites More sharing options...
wildteen88 Posted August 7, 2007 Share Posted August 7, 2007 Rather than use the browsers back button create a link to go back to the listings. When you press the back button IE will try to resubmit any data you just sent to the page. Quote Link to comment https://forums.phpfreaks.com/topic/63651-back-button-gives-an-expired-warning/#findComment-317197 Share on other sites More sharing options...
hitman6003 Posted August 7, 2007 Share Posted August 7, 2007 Don't click the back button... It's a browser thing, there's nothing you can do server side to prevent it that I know of off hand. The only thing that might work, and I've never tried it, so I don't know, is to set the expire header to some date in the future, rather than the past...however if the user visits the page in the future, but before the expire, and you want them to have updated data, the browser may not display it...it may pull from the cache. Quote Link to comment https://forums.phpfreaks.com/topic/63651-back-button-gives-an-expired-warning/#findComment-317198 Share on other sites More sharing options...
teng84 Posted August 7, 2007 Share Posted August 7, 2007 Don't click the back button... nice LOL thats the best answer i guess wildteen88 got it Quote Link to comment https://forums.phpfreaks.com/topic/63651-back-button-gives-an-expired-warning/#findComment-317201 Share on other sites More sharing options...
SCook Posted August 7, 2007 Author Share Posted August 7, 2007 Yes, well not clicking the button isn't the solution, as I have no control over what the users of this site do, and I garuntee they'll click the back button. There's got to be a way to just...go back. I think it must be partly because of the sessions, because in other circumstances, this does not happen Quote Link to comment https://forums.phpfreaks.com/topic/63651-back-button-gives-an-expired-warning/#findComment-317214 Share on other sites More sharing options...
teng84 Posted August 7, 2007 Share Posted August 7, 2007 i guess JS is what you need you can disable a back button using Java script Quote Link to comment https://forums.phpfreaks.com/topic/63651-back-button-gives-an-expired-warning/#findComment-317221 Share on other sites More sharing options...
AndyB Posted August 7, 2007 Share Posted August 7, 2007 There isn't any way to prevent people from using the browser controls (including the 'back' button). The best you can do is give them a clickable link back that's nice and obvious: <a href="javascript:history.go(-1)">Return to previous page</a> The alternative is to show the page in a new window. Then it'll have no history so the browser 'back' button will be useless. Then you'll need to close that window to get back to where you/they were: <a href="javascript:window.close()">Close this window</a> Quote Link to comment https://forums.phpfreaks.com/topic/63651-back-button-gives-an-expired-warning/#findComment-317223 Share on other sites More sharing options...
SCook Posted August 7, 2007 Author Share Posted August 7, 2007 Well, I did find a sort of "stop gap" solution to this problem. Instead of submitting my search form directly to listing.php, I use an intermediary file that then resends all posted form info to the listing.php like this: <? $qs = "?"; foreach ($_POST as $key => $val) { $qs .= $key . "=" . $val . "&"; } header("Location: listing.php$qs"); ?> It's not the best solution, because I'd rather not have this huge query string in the nav, but it isn't as if this is a big security issue, and one could always encode the data if desired. But it bypasses ht ebrowser's pychotic need to resubmit a form. What say ye? :-) Quote Link to comment https://forums.phpfreaks.com/topic/63651-back-button-gives-an-expired-warning/#findComment-317244 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.