Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Keep pages out of history

Reply
Thread Tools

Keep pages out of history

 
 
Colin Steadman
Guest
Posts: n/a
 
      02-04-2004
I'm setting up an intranet site which allows users to update a
database from the web. This works great so far, but there is... not
so much a problem, but an unwanted behavior that I would like to get
rid of.

Basically when a user updates something in the database from
PAGE1.ASP, I forward the user to a page called MESSAGES.ASP and either
display a success/failure message as appropriate. The following tag
then forwards the user to PAGE2.ASP after 2 seconds.

<meta http-equiv=refresh content=2;url=PAGE2.ASP>

There is a back button in PAGE2.ASP which the user can click to get
back to PAGE1.ASP. So far so good!

The problem is, if the user clicks the back button in the browser
instead of my back button, the user is redirected to the MESSAGES.ASP
page and not the PAGE1.ASP page as expected (we dont need to see the
message again)!

Is there anything I can do to avoid this as things get confusing very
quickly when this happens!

TIA,

Colin
 
Reply With Quote
 
 
 
 
Matthias Gutfeldt
Guest
Posts: n/a
 
      02-04-2004
Colin Steadman wrote:
> I'm setting up an intranet site which allows users to update a
> database from the web. This works great so far, but there is... not
> so much a problem, but an unwanted behavior that I would like to get
> rid of.
>
> Basically when a user updates something in the database from
> PAGE1.ASP, I forward the user to a page called MESSAGES.ASP and either
> display a success/failure message as appropriate. The following tag
> then forwards the user to PAGE2.ASP after 2 seconds.
>
> <meta http-equiv=refresh content=2;url=PAGE2.ASP>
>
> There is a back button in PAGE2.ASP which the user can click to get
> back to PAGE1.ASP. So far so good!
>
> The problem is, if the user clicks the back button in the browser
> instead of my back button, the user is redirected to the MESSAGES.ASP
> page and not the PAGE1.ASP page as expected (we dont need to see the
> message again)!
>
> Is there anything I can do to avoid this as things get confusing very
> quickly when this happens!


a) Change the program logic
b) Instruct the users not to use the browser 'Back' button
c) Run it all in a console window so there's no 'Back' button



Matthias

 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      02-04-2004

"Colin Steadman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I'm setting up an intranet site which allows users to update a
> database from the web. This works great so far, but there is... not
> so much a problem, but an unwanted behavior that I would like to get
> rid of.
>
> Basically when a user updates something in the database from
> PAGE1.ASP, I forward the user to a page called MESSAGES.ASP and either
> display a success/failure message as appropriate. The following tag
> then forwards the user to PAGE2.ASP after 2 seconds.
>
> <meta http-equiv=refresh content=2;url=PAGE2.ASP>
>
> There is a back button in PAGE2.ASP which the user can click to get
> back to PAGE1.ASP. So far so good!
>
> The problem is, if the user clicks the back button in the browser
> instead of my back button, the user is redirected to the MESSAGES.ASP
> page and not the PAGE1.ASP page as expected (we dont need to see the
> message again)!
>
> Is there anything I can do to avoid this as things get confusing very
> quickly when this happens!


There is no way to fiddle with the browsers history. Code your application
accordingly.

Cheers
Richard.


 
Reply With Quote
 
Kris
Guest
Posts: n/a
 
      02-04-2004
In article <(E-Mail Removed) >,
http://www.velocityreviews.com/forums/(E-Mail Removed) (Colin Steadman) wrote:

> I'm setting up an intranet site which allows users to update a
> database from the web. This works great so far, but there is... not
> so much a problem, but an unwanted behavior that I would like to get
> rid of.
>
> Basically when a user updates something in the database from
> PAGE1.ASP, I forward the user to a page called MESSAGES.ASP and either
> display a success/failure message as appropriate. The following tag
> then forwards the user to PAGE2.ASP after 2 seconds.
>
> <meta http-equiv=refresh content=2;url=PAGE2.ASP>
>
> There is a back button in PAGE2.ASP which the user can click to get
> back to PAGE1.ASP. So far so good!
>
> The problem is, if the user clicks the back button in the browser
> instead of my back button, the user is redirected to the MESSAGES.ASP
> page and not the PAGE1.ASP page as expected (we dont need to see the
> message again)!
>
> Is there anything I can do to avoid this as things get confusing very
> quickly when this happens!


Display the success-message in the page you are directing to, not
separately; so, don't attempt to mess with back-buttons or browser's
history, instead build your application more robust and usable.

If for instance the redirected page is a list of database items that one
returns to, display the success message above that list, clearly
indicated to draw attention (thick border, anyone?).

--
Kris
<(E-Mail Removed)> (nl)
<http://www.cinnamon.nl/>
 
Reply With Quote
 
Chris Morris
Guest
Posts: n/a
 
      02-04-2004
"rf" <(E-Mail Removed)> writes:
> There is no way to fiddle with the browsers history. Code your application
> accordingly.


Though there's a nasty bug in IE and Mozilla that we discovered here
(though others had spotted it first)

Demonstration at:
http://www.dur.ac.uk/c.i.morris/teststart.html

Not that I'd recommend this as a way of removing things from history
stacks, naturally.

--
Chris
 
Reply With Quote
 
Colin Steadman
Guest
Posts: n/a
 
      02-04-2004
Kris <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)4all.nl>...
> In article <(E-Mail Removed) >,
> (E-Mail Removed) (Colin Steadman) wrote:
>
> Display the success-message in the page you are directing to, not
> separately; so, don't attempt to mess with back-buttons or browser's
> history, instead build your application more robust and usable.



Bugger, I thought there might be a nice easy META or something I could
use!


> If for instance the redirected page is a list of database items that one
> returns to, display the success message above that list, clearly
> indicated to draw attention (thick border, anyone?).



I think I can do this. But instead of displaying the message above
the data, I think I can display the message own its own first, and
then the database information using some of the script from my
messages.asp page:


<html>
<head>
<title>TEST</title>

<%If Len(Session("message")) > 0 Then
<meta http-equiv="refresh" content="2; url=page1.asp">
<%End If%>

</head>

<body>

<%
If Len(Session("message")) > 0 Then
'Display database update message
Response.write Session("message")
Session("message") = ""
Else
'Display normal page
End If
%>

</body>
</html>


Thanks for your help (+ other contributors).

Colin
 
Reply With Quote
 
Kris
Guest
Posts: n/a
 
      02-04-2004
In article <(E-Mail Removed) >,
(E-Mail Removed) (Colin Steadman) wrote:

> Kris <(E-Mail Removed)> wrote in message
> news:<(E-Mail Removed)4all.nl>...
> > In article <(E-Mail Removed) >,
> > (E-Mail Removed) (Colin Steadman) wrote:
> >
> > Display the success-message in the page you are directing to, not
> > separately; so, don't attempt to mess with back-buttons or browser's
> > history, instead build your application more robust and usable.

>
>
> Bugger, I thought there might be a nice easy META or something I could
> use!


I am not so familiar with server side scripting other than some PHP, but
here is how I would do it in PHP. After processing the submitted form
and _before_ returning any data to the user's browser, send a HTTP
location header. It will instantly redirect to the page you specify (the
list I am talking about, for instance). No bypass record in browser
history, because there was simply not an inbetween page visited:

<?

//after processing form and before sending ANY data to the browser
(including spaces or other whitespace characters

header("Location: list.php");

?>

>
> > If for instance the redirected page is a list of database items that one
> > returns to, display the success message above that list, clearly
> > indicated to draw attention (thick border, anyone?).

>


--
Kris
<(E-Mail Removed)> (nl)
<http://www.cinnamon.nl/>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer - "Days to Keep Pages in History" setting Sir Berus MCDST 0 12-26-2006 11:23 PM
Values entered in the Form disappears when using the history.go(-1) or history.back() sujith.bolar@gmail.com Javascript 2 10-17-2006 08:12 PM
Recover Firefox web search history with history set to 0 days Sudip Chakraborty Firefox 2 11-21-2005 06:47 PM
[ANN] irb-history 1.0.0: Persistent, shared Readline history for IRB Sam Stephenson Ruby 1 06-18-2005 08:56 AM
history.dat, formhistory.dat - deleting deletes history? S.Rodgers Firefox 4 05-05-2005 01:03 AM



Advertisments