about browser

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!

Moderator: General Moderators

Post Reply
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

about browser

Post by hrubos »

How should I do in PHP if I want button "back" on toolbar of browser doesn't run???

Thank you in advance
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Could you explain a little better what you want to accomplish?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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:
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

If you're making a web app with limited distribution you could use XULrunner and customize the interface yourself...
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Re: about browser

Post 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. ;)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Back once won't harm you. Back twice is the same as back once without a redirect.
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post 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.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post 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.
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post 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?
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post 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.
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post by hrubos »

oki i will try, thank everybody
Post Reply