473,511 Members | 13,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Browser back after POST

Hello,

I got an annoying problem using the POST-method to send a form's data:

I put a login-form on the page which is sent by the POST-method to itself.
After that the content of the POST-variables will be checked
(!empty($_SESSION['xyz'])) and the rest of the page included.
In order to show some informations (e.g. "Welcome John Doe") and becoming
independent of specific POSTs, the data is also written to
SESSION-variables.
Now if I go to another page (by link) and after that back to the login-page
by the browser's "back"-button, it cannot be displayed ("The page cannot be
displayed...").
Only if I actualize the page it is displayed regularly.
I know that this problem doesn't appear by using the GET-method, but because
of security reasons I have to use POST.
So what can I do to fix that problem?
I don't want to disable the browsers back-button (or use some JavaScript).

Thanx very much in anticipation!!

Jul 17 '05 #1
3 5851
Bernd Kohler wrote:
Hello,

I got an annoying problem using the POST-method to send a form's data:

I put a login-form on the page which is sent by the POST-method to itself.
After that the content of the POST-variables will be checked
(!empty($_SESSION['xyz'])) and the rest of the page included.
In order to show some informations (e.g. "Welcome John Doe") and becoming
independent of specific POSTs, the data is also written to
SESSION-variables.
Now if I go to another page (by link) and after that back to the login-page
by the browser's "back"-button, it cannot be displayed ("The page cannot be
displayed...").
Only if I actualize the page it is displayed regularly.
I know that this problem doesn't appear by using the GET-method, but because
of security reasons I have to use POST.
So what can I do to fix that problem?
I don't want to disable the browsers back-button (or use some JavaScript).

Thanx very much in anticipation!!

maybe it is possible to include a half-way page:
[enter-data-page] -> [confirm enter, automatcally reroute page
(processes POST data)] -> [normal page] <--> [other pages]
As you can see, the page processing the post data is not called upon again.
Jul 17 '05 #2
Following on from Bernd Kohler's message. . .
Hello,

I got an annoying problem using the POST-method to send a form's data:

I put a login-form on the page which is sent by the POST-method to itself.
After that the content of the POST-variables will be checked
(!empty($_SESSION['xyz'])) and the rest of the page included.
In order to show some informations (e.g. "Welcome John Doe") and becoming
independent of specific POSTs, the data is also written to
SESSION-variables.
Now if I go to another page (by link) and after that back to the login-page
by the browser's "back"-button, it cannot be displayed ("The page cannot be
displayed...").
Only if I actualize the page it is displayed regularly.
I know that this problem doesn't appear by using the GET-method, but because
of security reasons I have to use POST.
So what can I do to fix that problem?
I don't want to disable the browsers back-button (or use some JavaScript).

Thanx very much in anticipation!!


Not an actual answer, but this is the sort of thing where you could
usefully try a number of browsers to see the variety of ways they react.
--
PETER FOX Not the same since the icecream business was liquidated
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Jul 17 '05 #3
When you submit the form, you are sending POST variables. When you click on
a link after submitting your form, you are taken to that link. Now, when you
click the back button, you are taken back - not to the original page - but
to the target page of your login form (which may happen to be your original
page, I don't know). The difference is that the page expects POST variables.
Because you are not supplying any, it displays nothing. There are two
solutions for you:

1. In your script, if there are no POST variables set, you should display
the original page as usual (I suspect that you do not, or do not have a
handler for this state)
2. Use a header("location: original_page.html");exit(); after you process
your POST variables. This will ensure that the target of your form is never
a displayed page on the client.

Regards,

PMK Media
http://www.pmkmedia.com
Jul 17 '05 #4

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

Similar topics

8
6618
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
3
9965
by: Rob | last post by:
Each time a webform is posted back (submitted), another URL is added to the browser's history list. My web application allows a back button to return to previously visited pages, but I do not wish...
4
1262
by: interuser | last post by:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="pagexxx.aspx.vb" Inherits="pagexxx"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- #include...
4
1417
by: Diffident | last post by:
Hello Guys, I am posting my weird experience on firefox by a piece of code I have written. That piece of code is supposed to be executed when the page is not posted back i.e., for the very first...
2
2557
by: junlia | last post by:
Hi All, I am working on a project that acts as a bridge. It does some checking with post xml data, and then redirects the request to an appropriate page. However, we find that depends on the...
3
3186
by: Rosanne | last post by:
Is there a way to clear the SelectedIndex of a listbox when the browser's back button is clicked? I have a page that contains a server side list box with AutoPostBack = True. When the user...
6
3916
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
3
12197
by: =?Utf-8?B?KioqKiBLaXRlT3JlZ29uICoqKio=?= | last post by:
I am displaying some dynamic data in a content page, how do i figure out the height and width of the browser in asp.net? I know i can write javascript on the client side to get the information,...
3
4223
by: Ian Semmel | last post by:
Is there a way to get the Page_Load event to fire if the user clicks the Back button on the browser rather than clicking a hyperlink ?
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.