Page 1 of 1

about browser

Posted: Fri Mar 09, 2007 11:40 am
by hrubos
How should I do in PHP if I want button "back" on toolbar of browser doesn't run???

Thank you in advance

Posted: Fri Mar 09, 2007 12:09 pm
by nickvd
Could you explain a little better what you want to accomplish?

Posted: Fri Mar 09, 2007 12:11 pm
by RobertGonzalez
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.

Posted: Fri Mar 09, 2007 12:18 pm
by Luke
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. :evil:

Posted: Fri Mar 09, 2007 12:48 pm
by Kieran Huggins
If you're making a web app with limited distribution you could use XULrunner and customize the interface yourself...

Re: about browser

Posted: Fri Mar 09, 2007 2:27 pm
by stereofrog
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. ;)

Posted: Fri Mar 09, 2007 4:26 pm
by RobertGonzalez
Back once won't harm you. Back twice is the same as back once without a redirect.

Posted: Fri Mar 09, 2007 9:15 pm
by Dale
AJAX :)

That should do it, that'll stop the back button from being used within the site - if that's what you're after.

Posted: Fri Mar 09, 2007 9:18 pm
by aaronhall
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.

Posted: Fri Mar 16, 2007 4:45 pm
by hrubos
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???

about AJAX?

Posted: Fri Mar 16, 2007 8:53 pm
by aaronhall
Like what's been said already, it's a bad idea to disable the back button (if you can manage to do so). Try using header() instead.

Posted: Sat Mar 17, 2007 12:18 pm
by hrubos
oki i will try, thank everybody