Page 1 of 1

Another question about back button

Posted: Sat Jun 01, 2002 10:16 am
by Bill H
I did a search and all the topics had to do with login/logout, password protection and multiple submission of forms.
My problem is much lower level than that.

I have a series of forms created by php: selection of an item in one page creates a page for selection of subitems of the selected item, etc.
(All coming from a MySQL database.)
Each form contains a "Return" button that moves the user up one level in the chain by means of <form action=blahblah.php>.

Problem arises when user clicks the back button and gets a "This page cannot be viewed without refresh" error. Any simple way to

A) allow user to use the back button without getting that error (obviously my first choice), or
B) prevent user from using the back button (gasp!)

Posted: Sat Jun 01, 2002 11:28 am
by ozmodiar
you could use a javascript window.open() function to open a new window for the first form. This allows you to select which window elements to show e.g. toolbar, addressbar, etc.

If you are not familiar with this function, try this link. It will tell you all you need to know.

http://msdn.microsoft.com/library/defau ... open_0.asp

Posted: Sat Jun 01, 2002 11:44 am
by volka
you may also create a button that is a link you created in your script with $_SERVER['HTTP_REFERER'] (only one 'back'-step of course :( )

or redirect to the same page without any post-data with header('Location:..... or meta-equiv

Posted: Sat Jun 01, 2002 1:17 pm
by gotDNS
You could set a session variable on each page for the last page they weer at, and then make a link out of it.