Keep pages out of history

Discussion in 'HTML' started by Colin Steadman, Feb 4, 2004.

  1. 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
    Colin Steadman, Feb 4, 2004
    #1
    1. Advertising

  2. 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
    Matthias Gutfeldt, Feb 4, 2004
    #2
    1. Advertising

  3. Colin Steadman

    rf Guest

    "Colin Steadman" <> wrote in message
    news:...
    > 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.
    rf, Feb 4, 2004
    #3
  4. Colin Steadman

    Kris Guest

    In article <>,
    (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
    <> (nl)
    <http://www.cinnamon.nl/>
    Kris, Feb 4, 2004
    #4
  5. Colin Steadman

    Chris Morris Guest

    "rf" <> 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
    Chris Morris, Feb 4, 2004
    #5
  6. Kris <> wrote in message news:<4all.nl>...
    > In article <>,
    > (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
    Colin Steadman, Feb 4, 2004
    #6
  7. Colin Steadman

    Kris Guest

    In article <>,
    (Colin Steadman) wrote:

    > Kris <> wrote in message
    > news:<4all.nl>...
    > > In article <>,
    > > (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
    <> (nl)
    <http://www.cinnamon.nl/>
    Kris, Feb 4, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Astra
    Replies:
    1
    Views:
    110
    Bullschmidt
    Jan 26, 2005
  2. Sam Stephenson
    Replies:
    1
    Views:
    217
    Andrew Walrond
    Jun 18, 2005
  3. Replies:
    2
    Views:
    280
    nutso fasst
    Oct 17, 2006
  4. Niall
    Replies:
    3
    Views:
    158
    Niall
    Dec 6, 2006
  5. hisan
    Replies:
    1
    Views:
    1,303
    Dan Stromberg
    Jun 25, 2012
Loading...

Share This Page