cbrooks Posted October 16, 2009 Share Posted October 16, 2009 I am creating a web site (using PHP) for a client and when a user enters information and then if he/she were to use the browsers backup key it might be confusing (for some people) seeing that the values that they entered had be reset. so the user might feel that the site had lost their info, when infact their info had be saved. Question: Can you turn 'OFF' the backup key on the users browser for the duration that they are on your site, forcing the user to use only the menu options on the site? Thanks According to 'Hillary' It takes a village to raise an Idiot! And My mother thanks you for your assistance in raising hers! Quote Link to comment https://forums.phpfreaks.com/topic/177920-dont-back-up/ Share on other sites More sharing options...
kickstart Posted October 16, 2009 Share Posted October 16, 2009 Hi Don't think you can consitantly, and some browsers do not reset the contents of the form fields (which is very useful when a web server is too busy to process your form and you don't want to retype it all again). All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/177920-dont-back-up/#findComment-938082 Share on other sites More sharing options...
mrMarcus Posted October 16, 2009 Share Posted October 16, 2009 just have the form auto-populate each field with either the entries from the db, or from session variables .. whichever way you're handling it, ie. echo '<input type="text" name="foo" value="'.(isset ($_SESSION['foo']) ? $_SESSION['foo'] : '').'" />'; something like that, anyways. will be different code obviously if you are taking from the db. last thing you want to do is make the user feel trapped, 'cause if they want to go back, they'll go back .. if they can't go back 'cause you took that option away, they'll close the page. much easier to create proper functionality to begin with than to take it away. Quote Link to comment https://forums.phpfreaks.com/topic/177920-dont-back-up/#findComment-938087 Share on other sites More sharing options...
.josh Posted October 16, 2009 Share Posted October 16, 2009 you cannot disable the browser's back button, even with javascript. Quote Link to comment https://forums.phpfreaks.com/topic/177920-dont-back-up/#findComment-938089 Share on other sites More sharing options...
PFMaBiSmAd Posted October 16, 2009 Share Posted October 16, 2009 With at least FF and IE, about the only way the browser would not keep the values in the form fields when using the back/forward buttons is if your script has redirected to the form page at some point in time without putting the current values into the value='' attributes (see what mrMarcus wrote in his post above.) When you do a header() redirect, that causes the browser to fetch the URL that is the target of the redirect. What is your actual code? Quote Link to comment https://forums.phpfreaks.com/topic/177920-dont-back-up/#findComment-938098 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.