472,978 Members | 2,406 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,978 software developers and data experts.

is this possible?

I have a php page which serves up multiple pages based on how the user
interacts with it - there are links on the first page that will reload (from
the same php file) a new page with form fields and submit buttons, and when
a user posts from that new page (or cancels), then the same php file is
again loaded, detecting how the user responded and generating the
appropriate html for whatever should be none next. All very typical.

What I want to know is, is there a way so that once a user has posted from
some submit button from one page (we'll say he Cancel's from a page that had
a form Cancel button so he returns to the original non-form default page
generated from the php file), can it be made so if the user then "refreshes"
the new page (hits the Refresh or Reload browser button) he does NOT get the
browser's "The page cannot be refreshed without resending the information.
Click Retry to send the information again, or click Cancel to return to the
page that you were trying to view." dialog? In other words, what I'd like is
a way to have the browser think that there was no posting done (even though
there was) once I've generated this certain 'home' page with my php code, so
that user ReLoad's of the page won't get this warning.

This is probably related also to problems I've had with "breaking the BACK
button" on sequences of php pages: if the user BACK's up to a page that was
generated by a post, it may not even be possible to regenerate the original
page. What's the best way of handling these situations??

-dg
Jul 16 '05 #1
3 5137
If a page was generated with a POST, then any refreshes of that page
will cause the browser to repost the data and cause the message to
appear. There's nothing you can do about that.

To solve your 'cancel' button scenario problem, you could us a <a
href=""> link to return to the home page instead of using a form
submission. You could style up the link using CSS to make it look like a
button if thats the effect you want.

Thats all the help i can offer :)

MK.

dan glenn wrote:
I have a php page which serves up multiple pages based on how the user
interacts with it - there are links on the first page that will reload (from
the same php file) a new page with form fields and submit buttons, and when
a user posts from that new page (or cancels), then the same php file is
again loaded, detecting how the user responded and generating the
appropriate html for whatever should be none next. All very typical.

What I want to know is, is there a way so that once a user has posted from
some submit button from one page (we'll say he Cancel's from a page that had
a form Cancel button so he returns to the original non-form default page
generated from the php file), can it be made so if the user then "refreshes"
the new page (hits the Refresh or Reload browser button) he does NOT get the
browser's "The page cannot be refreshed without resending the information.
Click Retry to send the information again, or click Cancel to return to the
page that you were trying to view." dialog? In other words, what I'd like is
a way to have the browser think that there was no posting done (even though
there was) once I've generated this certain 'home' page with my php code, so
that user ReLoad's of the page won't get this warning.

This is probably related also to problems I've had with "breaking the BACK
button" on sequences of php pages: if the user BACK's up to a page that was
generated by a post, it may not even be possible to regenerate the original
page. What's the best way of handling these situations??

-dg


--
MeerKat

Jul 16 '05 #2
dan glenn:
I have a php page which serves up multiple pages based on how the user
interacts with it - there are links on the first page that will reload
(from the same php file) a new page with form fields and submit buttons,
and when a user posts from that new page (or cancels), then the same php
file is again loaded, detecting how the user responded and generating the
appropriate html for whatever should be none next. All very typical.

What I want to know is, is there a way so that once a user has posted from
some submit button from one page (we'll say he Cancel's from a page that
had a form Cancel button so he returns to the original non-form default
page generated from the php file), can it be made so if the user then
"refreshes" the new page (hits the Refresh or Reload browser button) he
does NOT get the browser's "The page cannot be refreshed without resending
the information. Click Retry to send the information again, or click
Cancel to return to the page that you were trying to view." dialog? In
other words, what I'd like is a way to have the browser think that there
was no posting done (even though there was) once I've generated this
certain 'home' page with my php code, so that user ReLoad's of the page
won't get this warning.

The simplest way is to use header("Location:<url>"). When for example the
user hits cancel, you call that function and send him to where he should
go. This is a general solution which can be applied whenever you need to
process POST data and then return a page that can still be refreshed. It
also fixes the problem of "double posting".
This is probably related also to problems I've had with "breaking the BACK
button" on sequences of php pages: if the user BACK's up to a page that
was generated by a post, it may not even be possible to regenerate the
original page. What's the best way of handling these situations??


Well if the page was actually generated based on POST data there is nothing
you can do, and the user simply chooses whether to repost or not. It
depends on the situation so I can't really give you a clearer answer. In my
applications however I've always been able to avoid the pesky "page was
generated from a post request", so it shouldn't be too hard.

André Nęss
Jul 16 '05 #3
André Nęss wrote:
dan glenn:

I have a php page which serves up multiple pages based on how the user
interacts with it - there are links on the first page that will reload
(from the same php file) a new page with form fields and submit buttons,
and when a user posts from that new page (or cancels), then the same php
file is again loaded, detecting how the user responded and generating the
appropriate html for whatever should be none next. All very typical.

What I want to know is, is there a way so that once a user has posted from
some submit button from one page (we'll say he Cancel's from a page that
had a form Cancel button so he returns to the original non-form default
page generated from the php file), can it be made so if the user then
"refreshes" the new page (hits the Refresh or Reload browser button) he
does NOT get the browser's "The page cannot be refreshed without resending
the information. Click Retry to send the information again, or click
Cancel to return to the page that you were trying to view." dialog? In
other words, what I'd like is a way to have the browser think that there
was no posting done (even though there was) once I've generated this
certain 'home' page with my php code, so that user ReLoad's of the page
won't get this warning.

The simplest way is to use header("Location:<url>"). When for example the
user hits cancel, you call that function and send him to where he should
go. This is a general solution which can be applied whenever you need to
process POST data and then return a page that can still be refreshed. It
also fixes the problem of "double posting".


So, when a user clicks 'cancel', you are still POSTing to the same url,
which detects that cancel has been pressed and then redirects to itself?
Is this right?
This is probably related also to problems I've had with "breaking the BACK
button" on sequences of php pages: if the user BACK's up to a page that
was generated by a post, it may not even be possible to regenerate the
original page. What's the best way of handling these situations??

Well if the page was actually generated based on POST data there is nothing
you can do, and the user simply chooses whether to repost or not. It
depends on the situation so I can't really give you a clearer answer. In my
applications however I've always been able to avoid the pesky "page was
generated from a post request", so it shouldn't be too hard.

André Nęss


--
MeerKat

Jul 16 '05 #4

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

Similar topics

4
by: Julia Briggs | last post by:
I am struggling to create a PHP function that would take a specified image (JPG, GIF or PNG) from a link, and resize it down to a thumbnail so it will always fit in a 200x250 space. I am hoping...
36
by: rbt | last post by:
Say I have a list that has 3 letters in it: I want to print all the possible 4 digit combinations of those 3 letters: 4^3 = 64 aaaa
20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
7
by: Andrzej | last post by:
Is it possible to call a function which name is given by a string? Let assume that I created a program which call some functions for example void f1(void), void f2(void), void f3(void). ...
2
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
1
by: AAA | last post by:
hi, I'll explain fastly the program that i'm doing.. the computer asks me to enter the cardinal of a set X ( called "dimX" type integer)where X is a table of one dimension and then to fill it...
25
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e....
4
by: RSH | last post by:
Okay my math skills aren't waht they used to be... With that being said what Im trying to do is create a matrix that given x number of columns, and y number of possible values i want to generate...
7
by: Robert S. | last post by:
Searching some time now for documents on this but still did not find anything about it: Is it possible to replace the entry screen of MS Office Access 2007 - that one presenting that default...
14
by: bjorklund.emil | last post by:
Hello pythonistas. I'm a newbie to pretty much both programming and Python. I have a task that involves writing a test script for every possible combination of preference settings for a software...
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=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.