when you go back in browser, search results page does not display - how can you prevent?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NotGiven

    when you go back in browser, search results page does not display - how can you prevent?

    Say you have three pages, a search page, a results/master, and a detail
    page.

    You choose parameters on your search page and submit the page.
    The results show in the reults/master page.
    You click one to go the details page.
    You hit the browser button to go back and it shows the results/master page
    but shows "Page has expired" error.

    How can you prevent this? How can you show the results page whether you get
    there forwards or backwards?


  • Nikolai Chuvakhin

    #2
    Re: when you go back in browser, search results page does not display - how can you prevent?

    "NotGiven" <noname@nonegiv en.net> wrote in message
    news:<ICORc.741 2$5i4.7204@bign ews3.bellsouth. net>...[color=blue]
    >
    > Say you have three pages, a search page, a results/master, and a detail
    > page.
    >
    > You choose parameters on your search page and submit the page.
    > The results show in the reults/master page.
    > You click one to go the details page.
    > You hit the browser button to go back and it shows the results/master page
    > but shows "Page has expired" error.
    >
    > How can you prevent this?[/color]

    You can either allow the results page to be cached or open the detail
    page in a new browser window using <a href="detail.ph p" target=_blank>
    or JavaScript. The latter will also allow you to specify the size
    of the new window and show it without menu bar and status bar, so
    it won't obscure the results window and the user will know they are
    in a new window and can return to results by closing the detail window.

    Cheers,
    NC

    Comment

    • NotGiven

      #3
      Re: when you go back in browser, search results page does not display - how can you prevent?

      how do you specify allowing the page to be cached? Thanks in advance


      "Nikolai Chuvakhin" <nc@iname.com > wrote in message
      news:32d7a63c.0 408100914.16426 fdf@posting.goo gle.com...[color=blue]
      > "NotGiven" <noname@nonegiv en.net> wrote in message
      > news:<ICORc.741 2$5i4.7204@bign ews3.bellsouth. net>...[color=green]
      > >
      > > Say you have three pages, a search page, a results/master, and a detail
      > > page.
      > >
      > > You choose parameters on your search page and submit the page.
      > > The results show in the reults/master page.
      > > You click one to go the details page.
      > > You hit the browser button to go back and it shows the results/master[/color][/color]
      page[color=blue][color=green]
      > > but shows "Page has expired" error.
      > >
      > > How can you prevent this?[/color]
      >
      > You can either allow the results page to be cached or open the detail
      > page in a new browser window using <a href="detail.ph p" target=_blank>
      > or JavaScript. The latter will also allow you to specify the size
      > of the new window and show it without menu bar and status bar, so
      > it won't obscure the results window and the user will know they are
      > in a new window and can return to results by closing the detail window.
      >
      > Cheers,
      > NC[/color]


      Comment

      • Justin Koivisto

        #4
        Re: when you go back in browser, search results page does not display- how can you prevent?

        Nikolai Chuvakhin wrote:
        [color=blue]
        > "NotGiven" <noname@nonegiv en.net> wrote in message
        > news:<ICORc.741 2$5i4.7204@bign ews3.bellsouth. net>...
        >[color=green]
        >>Say you have three pages, a search page, a results/master, and a detail
        >>page.
        >>
        >>You choose parameters on your search page and submit the page.
        >>The results show in the reults/master page.
        >>You click one to go the details page.
        >>You hit the browser button to go back and it shows the results/master page
        >>but shows "Page has expired" error.
        >>
        >>How can you prevent this?[/color]
        >
        >
        > You can either allow the results page to be cached or open the detail
        > page in a new browser window using <a href="detail.ph p" target=_blank>
        > or JavaScript. The latter will also allow you to specify the size
        > of the new window and show it without menu bar and status bar, so
        > it won't obscure the results window and the user will know they are
        > in a new window and can return to results by closing the detail window.[/color]

        ....or simply have the search form GET instead of POST...

        --
        Justin Koivisto - spam@koivi.com
        PHP POSTERS: Please use comp.lang.php for PHP related questions,
        alt.php* groups are not recommended.

        Comment

        • Nikolai Chuvakhin

          #5
          Re: when you go back in browser, search results page does not display - how can you prevent?

          "NotGiven" <noname@nonegiv en.net> wrote in message
          news:<QO7Sc.892 9$5i4.1512@bign ews3.bellsouth. net>...[color=blue]
          >
          > how do you specify allowing the page to be cached?[/color]

          By sending the appropriate headers to the client. Example:

          header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
          header('Expires : ' . gmdate('D, d M Y H:i:s', strtotime('+1 hour')) . ' GMT');

          This tells the client that the page was last modified when it was
          called and will not change for an hour. So a smart client would
          cache the page at the first load and won't attempt to load it again
          if it visits it within an hour, but rather load a cached copy.

          A word of caution: assuming a client is smart can lead to frustrating
          results...

          Cheers,
          NC

          Comment

          Working...