473,233 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,233 software developers and data experts.

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?

Jul 17 '05 #1
6 2626
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_limiter('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

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

Jul 17 '05 #3
paristhedog wrote:
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.


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/

Jul 17 '05 #4
In article <11**********************@g14g2000cwa.googlegroups .com>, "R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote:
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_limiter('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


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/
Jul 17 '05 #5
Jørn Dahl-Stamnes wrote:

[about IE's 'Warning: Page has Expired' nonsense]
I have only had experience of this as a user on a web-site.
For no fault of the Web site author, let it be said.
IE 6.0 gave me this "error messages" all the time. After I changed
my browser to FireFox, the "error" was gone.


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
Jul 17 '05 #6
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_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
IE to cache the page.
If using session, add session_cache_limiter('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

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_limiter('private,
must-revalidate');
Otherwise, add header('private, must-revalidate');

Refer:
http://www.mnot.net/cache_docs/

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

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve | last post by:
Hello, In my first (of 2) aspx page I have 2 listboxes. I populate the first listbox in the PageLoad event If Not IsPostBack Then .... When I select an item from the first listbox, lst1,...
2
by: Ersin Gençtürk | last post by:
I show errors as popup boxes via alert() but I write this scripts in header of html page.So if there is an error on the server side , in the next postback a popup shows the error via alert , this...
29
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. ...
4
by: Alan Wang | last post by:
Hi there, I am having a problem with my asp.net web pages. If user hit BACK button on IE and then click some other web controls on the web page. the page goes to blank page. Anyone has the...
5
by: ns21 | last post by:
How can the browser back button be disabled If the form is submitting information to other pages or submitting to itself or using redirections. I tried the tweaks like history.forward(1) in each...
4
by: bendlam | last post by:
I have a page that contains search criteria and when you click on the search button it causes a post back that populates a dataview on the same page. One of the gridview columns contains a link...
3
by: Tom | last post by:
Basically I have a page that I load with 10 input fields. If users have JS enabled I want to hide 5 of these fields so as to reduce clutter. If the user needs these extra fields an "Add" button can...
12
by: jim.richardson | last post by:
Hi all, I'd like a page to be excluded from the back button history, that is, when a user hits their browser's back button, it never backs into this particular page. Can anybody please tell...
1
by: phancey | last post by:
hi, I've got an asp.net app. In case of unhandled exceptions, the web.config is set up to redirect the user to an error page. If the user then clicks the back button to retry, they have lost all...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.