472,780 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 5806
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
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
3
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
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
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
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
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
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
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
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
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.