Back Button Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • theouimets@gmail.com

    Back Button Error

    After submitting a form from a PHP script and using the back button I
    get a page cannot be displayed error. Everything works find except when
    the back button is used. Using IE with SP2 on Windows XP Pro any ideas?

  • R. Rajesh Jeba Anbiah

    #2
    [FAQ] Form data lost on back button (Was Re: Back Button Error)

    Q: Why am I getting "Warning: Page has Expired" error when hitting back
    button after form submit?
    Q: How do I preserve form data after submitting but returning using
    back button?

    A: When the browser looks the page in the cache and if the page is not
    available there, you may be getting "Warning: Page has Expired" error.
    This usually happens when the page uses session as PHP's default
    session.cache_l imiter setting is "nocache"--which will send nocache
    HTTP header to the browser.
    So, the workaround is to forcibly send the HTTP headers so as to force
    the browser to cache the page.
    If using session, add session_cache_l imiter('private ,
    must-revalidate');
    Otherwise, add header('private , must-revalidate');
    This may solve the issue.

    Refer:
    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.



    Comment

    • paristhedog

      #3
      Re: Form data lost on back button (Was Re: Back Button Error)

      Thanks but that didn't seem to help. I am still getting the following
      using the back button (other pages from other sites work fine):

      The page cannot be displayed
      The page you are looking for is currently unavailable. The Web site
      might be experiencing technical difficulties, or you may need to adjust
      your browser settings.

      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: Form data lost on back button (Was Re: Back Button Error)

        paristhedog wrote:[color=blue]
        > Thanks but that didn't seem to help. I am still getting the following
        > using the back button (other pages from other sites work fine):
        >
        > The page cannot be displayed
        > The page you are looking for is currently unavailable. The Web site
        > might be experiencing technical difficulties, or you may need to[/color]
        adjust[color=blue]
        > your browser settings.[/color]

        Sniff the header and post here. Just curious to look at the header.

        --
        <?php echo 'Just another PHP saint'; ?>
        Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

        Comment

        • Jørn Dahl-Stamnes

          #5
          Re: [FAQ] Form data lost on back button (Was Re: Back Button Error)

          In article <1111426029.362 952.121790@g14g 2000cwa.googleg roups.com>, "R. Rajesh Jeba Anbiah" <ng4rrjanbiah@r ediffmail.com> wrote:[color=blue]
          >Q: Why am I getting "Warning: Page has Expired" error when hitting back
          >button after form submit?
          >Q: How do I preserve form data after submitting but returning using
          >back button?
          >
          >A: When the browser looks the page in the cache and if the page is not
          >available there, you may be getting "Warning: Page has Expired" error.
          >This usually happens when the page uses session as PHP's default
          >session.cache_ limiter setting is "nocache"--which will send nocache
          >HTTP header to the browser.
          >So, the workaround is to forcibly send the HTTP headers so as to force
          >the browser to cache the page.
          >If using session, add session_cache_l imiter('private ,
          >must-revalidate');
          >Otherwise, add header('private , must-revalidate');
          >This may solve the issue.
          >
          >Refer:
          >http://www.php.net/sesssion_cache_limiter
          >http://www.php.net/header[/color]

          I have only had experience of this as a user on a web-site. IE 6.0 gave me
          this "error messages" all the time. After I changed my browser to FireFox, the
          "error" was gone.

          --
          Jørn Dahl-Stamnes
          Homepage: http://www.dahl-stamnes.net/dahls/

          Comment

          • John Dunlop

            #6
            Re: [FAQ] Form data lost on back button (Was Re: Back Button Error)

            Jørn Dahl-Stamnes wrote:

            [about IE's 'Warning: Page has Expired' nonsense]
            [color=blue]
            > I have only had experience of this as a user on a web-site.[/color]

            For no fault of the Web site author, let it be said.
            [color=blue]
            > IE 6.0 gave me this "error messages" all the time. After I changed
            > my browser to FireFox, the "error" was gone.[/color]

            Because the warning is a bug, which real browsers, like your
            Firefox, are free of.

            You bring up a good point, one worth noting in the FAQ, I
            daresay. That is, as far as I know, the workaround exists
            solely to counter IE's misbehaviour. I'd be saddened to learn
            of other browsers with this bug.

            The workaround affects everyone though. Before, the provider
            asked for the page not to be cached, but now, just because of
            IE, he's asking for it to be cached. That's wrong.

            --
            Jock

            Comment

            • R. Rajesh Jeba Anbiah

              #7
              Re: [FAQ] Form data lost on back button (Was Re: Back Button Error)

              Q: Why am I getting "Warning: Page has Expired" error when hitting back
              button after form submit?
              A: This is IE only error. When IE looks the page in the cache and if
              the page is not available there, you may be getting "Warning: Page has
              Expired" error. This usually happens when the page uses session as
              PHP's default session.cache_l imiter setting is "nocache"--which will
              send nocache HTTP header to the browser.
              So, the workaround is to forcibly send the HTTP headers so as to force
              IE to cache the page.
              If using session, add session_cache_l imiter('private ,
              must-revalidate');
              Otherwise, add header('private , must-revalidate');
              This may solve the issue.

              Refer:
              PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.



              Q: How do I preserve form data after submitting but returning using
              back button?
              A: You can instruct the browser to cache the page by sending proper
              HTTP headers. But, note that the browser setting will take priority in
              determining whether to follow the HTTP headers or not.
              If using session, add session_cache_l imiter('private ,
              must-revalidate');
              Otherwise, add header('private , must-revalidate');

              Refer:
              Covers the how's and why's of Web caching for people who publish on the Web. With FAQs.


              +++++
              @revision 2 See comments. The bug is IE only

              Comment

              Working...