Back Button

Discussion in 'Javascript' started by The Magnet, Nov 8, 2009.

  1. The Magnet

    The Magnet Guest

    Hi,

    I'm looking to change the location of where the page goes when someone
    hits the back button.

    I have a page which the user fills out a form, hits SUBMIT. It does
    it's PHP thing, sends me the info, and then puts up a confirmation
    page with a link to another page. At that point, if the user hits the
    browsers 'BACK' button, it goes back, and I've put in a session
    variable to re-direct the page using "header", but it still sends me
    the confirmation again???

    How can that be when I check for the session variable first thing:

    <?
    session_start();
    if ($_SESSION['BACK'] == "Y") {
    header("Location: feedback.php");
    }

    First thing in the page. It goes back to 'feedback.php' properly, but
    not before sending me another email.

    Any ideas why??
     
    The Magnet, Nov 8, 2009
    #1
    1. Advertising

  2. The Magnet

    Eric Bednarz Guest

    The Magnet <> writes:

    > I'm looking to change the location of where the page goes when someone
    > hits the back button.


    You are looking for the right news group to post this to, too.

    > <?
    > session_start();
    > if ($_SESSION['BACK'] == "Y") {
    > header("Location: feedback.php");
    > }
    >
    > First thing in the page. It goes back to 'feedback.php' properly, but
    > not before sending me another email.


    You probably did not call exit or die after that, but that’s irrelevant.

    You need to read RFC 2616. There you find status code 303 explained, and
    why the location value in your header is invalid.
     
    Eric Bednarz, Nov 8, 2009
    #2
    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. sylvia sil
    Replies:
    1
    Views:
    638
    Curt_C [MVP]
    Dec 29, 2004
  2. Chicagoboy27

    image button as a back button

    Chicagoboy27, Oct 26, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    2,038
    Chicagoboy27
    Oct 30, 2006
  3. phancey
    Replies:
    3
    Views:
    2,599
  4. Author
    Replies:
    6
    Views:
    3,206
    George
    Jan 22, 2009
  5. Useful Info

    Firefox back button takes me back 2 pages.

    Useful Info, Jun 3, 2007, in forum: Javascript
    Replies:
    0
    Views:
    355
    Useful Info
    Jun 3, 2007
Loading...

Share This Page