467,915 Members | 1,181 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

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?
Jul 17 '05 #1
  • viewed: 2366
Share:
4 Replies
"NotGiven" <no****@nonegiven.net> wrote in message
news:<IC*****************@bignews3.bellsouth.net>. ..

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?


You can either allow the results page to be cached or open the detail
page in a new browser window using <a href="detail.php" 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
Jul 17 '05 #2
how do you specify allowing the page to be cached? Thanks in advance
"Nikolai Chuvakhin" <nc@iname.com> wrote in message
news:32**************************@posting.google.c om...
"NotGiven" <no****@nonegiven.net> wrote in message
news:<IC*****************@bignews3.bellsouth.net>. ..

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?


You can either allow the results page to be cached or open the detail
page in a new browser window using <a href="detail.php" 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

Jul 17 '05 #3
Nikolai Chuvakhin wrote:
"NotGiven" <no****@nonegiven.net> wrote in message
news:<IC*****************@bignews3.bellsouth.net>. ..
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?

You can either allow the results page to be cached or open the detail
page in a new browser window using <a href="detail.php" 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.


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

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #4
"NotGiven" <no****@nonegiven.net> wrote in message
news:<QO*****************@bignews3.bellsouth.net>. ..

how do you specify allowing the page to be cached?


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
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Penny Bond | last post: by
6 posts views Thread by guoqi zheng | last post: by
1 post views Thread by terryshamir | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.