PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
You're not going to do it. The back button will always work. You can control some page specific things with the appropriate cache-control settings and the header() function, but the user will always have the ability to use the back button.
and even if you could reliably disable the back button, it would require a client-side technology such as javascript (which can be disabled). You don't want to disable the back button anyway. Disabling the back button really <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> off users. I know for a fact because when a site disables my back button I leave.
hrubos wrote:How should I do in PHP if I want button "back" on toolbar of browser doesn't run???
You should do a redirect (header("Location:...")) after every request that changes the state, especially POST requests. If you do so, the "back" button will never harm you.
Everah wrote:Back once won't harm you. Back twice is the same as back once without a redirect.
In my experience, Mozilla (and maybe others) doesn't record pages with a 'Location' header, and "skips over" redirects when using back/forward. This wouldn't be the same for Meta redirects, obviously.
I have done a information system for resrevation.So while user book, they can't click back button in a toolbar of browser. So Should you show me detaily how to do???