Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Browser Back After POST


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).




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Back Button On Your Browser
My question is based around back button on your browser .

Currently I have a form that feeds it's information into a MySql database. I give my users the ability to add, edit, and delete entries. Because of this I use actions on my submit button,
( if action=edit) {blah blah blah}
else blah blah

If a users make and addition everything is fine, butif they press the back button, the action is carried out again. (because the action is in the url (www.blahhblah.com/form.php?action=add)

this puts duplicate entries into the database, which is easy to fix, but annoying.

Is there a way with PHP to force the timeout page everytime they try to re-enter the form from their back button?

BACK Button In Browser
I would like the browser to refresh the page when I'm clicking BACK
button. Does anybody know how to do that?

Back Button On Browser?
is there a way to disable the Back button on the browser? i would like to prevent users from using it to go to the previous page!

Sessions And Browser Back Button
I originaly wrote a script that passed variables from script to script via query strings. When I did that, the user was able to use the back button to go back to previous pages and change form inputs. Then I changed my scripts to use session variables to get rid of the long query strings. Now, when the user hits the back button: "Warning Page has Expired" is what they get. Why is that?

Inhibiting Browser Back/Fwd Buttons Via PHP?
Is it possible to inhibit the browser Back/Fwd buttons via PHP?

Unable To Use The Back Button On The Browser
On my site, which uses sessions to log in and track users, if the back button on the browser is used the page times out and says you have to hit the refresh button to refresh the page you were trying to get back to. Not very user friendly, anybody have any ideas why??

There is a function called do_authentication that is called at the top of every page to check the user has logged in and has the appropriate rights. I don't think it is to do with the sessions though as if you hit the refresh buttin on the page with the error you are allowed back to the page you were trying to get to?

Browser Back Button/caching And Php
Can the browser back button or browser caching be turned on or off via php?

Back A Page In Browser History
Is there a PHP snippet that will take a user back one page in browser history, or is everyone still using the JavaScript equivalent?

Shopping Cart Navigation And Back Button Browser
I am building a shopping cart where the user adds items to his shopping cart and shippes some to himself and others to someone else as a gift.

I do the following thing, First let the user fillout his info and I ask him to check which items does he want to send to himself. Once he hit submit button I do the following.

1) I process which poduct does he want to ship to himself. Then I remove those products from the shopping cart.

2) Then if he has items in his shopping cart remaining I display address form and checkboxes asking user to check all items that he want to ship to this address.

then I repeat step 2 until the user has no more items in his shopping cart. when he has no items I will display billing page.

Here is my problem if user hits back button in the browser and then enters submit button I have not items in the shoppingcart since I removed them from his shopping cart the first time he processed his form.

So how do I deal with back button in the browser. I have no idea how to it when I have multiple forms.

How To Go Back After Form Post ?
Whats the best way to allow a user to go back to an input form after doing a submit, and still have their data in the form ?

Pressing Browser Back Button - Form Filled Data Disappeared
When filling out a web form on a php page that is submitted to a search
which lists the results based on the criteria provided (in the form), all
works fine and as expected.

However, when I press the back button to amend the form all of the search
criteria data has gone and I have to fill it all out again if I want to do a
similar search which is frustrating. (This does not actually happen in
Firefox browser but most of my users will be using IE). How can I prevent
this from happening?

Previously I made a post about avoiding "Page has expired" and the
conclusion I came to for that was not to use a "POST" which did the trick.
But now I want to retain the data I input?

Back Button POST Issue
Is there any way of disabling the repost of information when a user
hits the back button?

Is the only way to do this to actually use some sort of redirect on the
page receiving the initial post (though this won't stop them hitting
back twice and possibly reposting will it?)

Back Button, Page Expired, GET And POST
I have read you can solve the back button problem with the page expiration by using GET method instead of POST. When I use the GET method with form data, it doesn't work.

I have a page with a dropdown submitting to a page getting the variable via POST. Then it links to another page, and I want them to be able to come back to the second page. When I use GET instead of POST I get an error.

Maintaining User Entry On Form Post Even When Going Back..
having a hard time retaining user entries on my form on submission if they want to change a certain entry.. when they click back on the browser all the fields are blank.

Can One 'kill' Post In The Browser?
can one 'kill' post in the browser?

Getting Info Using POST Automatically (without A Browser)
I'm writing a script to harvest data from a number of different sites. Some of these use a FORM with method=POST to display the data I want - however I want the script to run using CRON without any user intervention (ie. there's nobody around to press a submit button).

"Warning: Page Has Expired" - How To Aviod When Using Browser Back Button?
In summary:
I want to a form to submit information via a HTTP POST, however, when using
Internet Explorer I want to be able to use the back button and all the
information retained. Presently we get a "Page has expired" message. How can
we avoid this?

Full details:
Having searched for postings on how to avoid the "Page has Expired" they are
numerous, however, I have not found one that answers the question
adequately.

Hence this posting.

One posting directed me to the following webpage:
http://in.php.net/session_cache_limiter

but I played around with "session_cache_limiter()" and it did not give the
desired results. (It seem to make no difference). Also many people say to
use HTTP GET instead but this is not an option in this case.

Where can I find concise definitive information on how to avoid "Warning:
Page has Expired" and allow the user to press the back button and see the
form as it was before they submitted it?

How To Determine If The Browser Is An English Browser
need to seperated english traffic from the rest of it. What is the easiest way to do this? get_brower() seems pretty complicated, and from what i here sucks pretty bad!

Post And Redirect With Post Data
The solution we have though up is the following:

1. The user fills in data in a form and hits submit
- This submits (POST) to another page (redirect.php)
2. redirect.php adds more POST data to POST and then submits all this POST data to another page (offsite [payment portal])

The reason why we have to do this is for someone who knows our to read html source code, could easily find the sucessful page which will then do the processing we need to do on our side. Which means freebeis.

Calling A Post Script From A Post Script; Curl Works But ...
I am trying to call a php script B from script A.

However, when I do this with curl everything works fine except the url of the script is the url of script A. How can I make the URL the URL of script B.

Is this possible with curl?

PHP Post, Then HTML Post?
Using PHP, I want to POST or GET some variables to a second php page.
This, I already know how to do.

However, on the second php page, I want to use a simple, standard HTML
form using the standard form-submitting method such as:

<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

whereupon both sets of variables --- the earlier variables that were
POSTed or GETted to the second page, along with the standard form
variables derived within the second page --- will be POSTed to the
above URL.

In the second page, might I actually translate the received variables
into actual HTML code? For instance, if my first page POSTed the
variable xyz to the second page, then might the following code on the
second page receive that variable and then include it when the second
page's "Submit" button is pressed?

<? $xyz=$_POST['xyz']; ?>
<INPUT TYPE="HIDDEN" NAME="xyz" value="<?=$_POST['xyz']?>" >

Or how, otherwise, might this be done?

Getting Back To Where I Started.
I use a login script and since it's accessable from every page on my site I would like the user to go back to the place where he started.

I use a template file in which the loginfields are placed and where I call a different .inc for each other page, so it doesn't make sense to hard code the 'gobackurl', is there a function to retrieve the pageurl from where the user came or another solution, let me know?

Welcome Back....your Last Visit Was...
I would like to add a feature to my site on the main page that says the following:

Welcome back, Joe user! Your last visit was July 20, 2002.

I figure I could do this by using sessions (which I plan to use for other tasks anyway) and inserting/updating info in a table for user_sessions, but how would I (in PHP) get the last visit info (assuming the user has already logged in)?

Back Function
how to create back url that will by inteligent, I mean ll go back independet
from with page you came?

1 Form To Another And Back
how can i have a form with submit button open in a new page from where i select some options and sends and refresh data from this new page back to the old one Code:

Back After Logout
I have created a web in the 1st page. User can login. After login i start the session and save it in his db-record. Also the page give a link to my important page. In that page I check the saved sid and current sid. If both are equal, it will display some details, that page have the logout link.when user click that link. The logout.php will work. It generate a new sid for the
same user. my problem is after logout when the user back from logout.php it will show all contents of the my important page. If refreshing that page it didn`t show anything. So how can i make sure that when the user back it automatically refresh the page.

BACK Problem
I have a page that takes some parameters. They are used to add items to
a cart:
add_cart.php?itemid=1234&vid=9876
This takes me to the cart page (as in "View Cart" page.)
The problem I have is that if I click on the BACK button, I get another
(of the same) item added to the cart because
"add_cart.php?itemid=1234&vid=9876" is executed again.

Back Link In Url
i have a page where the user needs to be logged in in order to use it, so if they are not logged in it sends them to the login page. once they login it should send them to the page they were trying to go to. the problem is that the url keeps the login page and just adds the new url at the end. here is the code any ideas? PHP Code:

Back Button
I have two questions.

1. When the user presses the back button and returns to a form he filled
the form is reseted. How do I leave there the values he inserted?

2. When the user comes back to a page where he had a submitted POST data
the browser keeps telling that the data has expired and asks if repost. How
to avoid that? I tried registering all POST and GET vars as SESSION vars but
it also has its disadvantages...

Getting HTML Back!
I have a record in a database which contains 'The Enter Key' (moving down a line) in it a couple of times. when i fetch it and echo it on a page, it is like it has changed them for spaces... can anyone give me code to re-HTML it?

Different Back Grounds
i have a dating website so when a member signs up they get there own profile page almost like every other dating site out there what i what to do is give them the option to change there profile page template to other templates i will have up for them can anyone tell me how this can be done?

Back Button Problem
On my development site: http://beta.deluxeportal.com/index.php I'm having some strange problems with the back button...

For example, if you try posting and leave out a message, you get an error. You can press back to return to the posting page. This is how it works on most pages, and this is what I want. However, on a very select number of pages (the login page, and the search page), if you get the error message and press back, you still get the screen with the error message. Then, the next time you press back, you are completely taken out of the page.

I haven't been able to figure this out, as I can't see anything that makes those pages different from the others.

'Back' Page After Logout
I'm using HTTP authentication as my login mechanism, and I'm having problems with the logout. It appears to work (as in I get the right message when I've logged out) but pressing the 'Back' button gives me the information on the previous page as though I hadn't logged out at all.

1) Does $PHP_AUTH_USER not get cleared when a "401 Unauthorized" is encountered?

2) Is there any way to force the logout to apply to previous pages (I'm thinking using sessions or cookies perhaps), or do I have to get the user to close the browser window?

Disabling The Back Button
I have a form that is to be filled. The summit button call a php script that populates a database. Is there a way to make sure that if someone click on the back button on the browser they do not get a chance to send the same form again.

Back Button And Sessions
When I create a session-based site and hit the back button I get this error:

Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh button.


How do I avoid that, or at least create a back button on my page that works like the browser's back button does?

Thanks!

$_POST And $_SESSION Back And Forth
I was fighting a bad case of session persistence
and found a solution but need to be reassured about is reliability
$dir=$_SESSION['dir']; //echo"dir.$dir.<br>";
if
($_SESSION['dir']=="")
{
$dir=$_POST['dir'];
$_SESSION['dir']=$dir;
$dir=$_SESSION['dir']; //echo"dir2.$dir.<br>";
}
else
{
$dir=$_SESSION['dir']; //echo"dir3.$dir.<br>";
}

forgot stating that the problem was when the original file passed a POST value to other files and then going back to that original file from other locations.

How To Switch To Ssl And Back Again From Same Php Script?
In one of my apps I handle many functions and pages as opposed to separate
scripts for separate pages. Most of the work is non-SSL and works just
fine. However, when I am delivering pages with sensitive information the
form action parameter references the full URL including the https:// to
force the server to process with SSL. This seems to work just fine
although there is most likely a better way to do this.

Now, my question: Once the SSL part is done and the next page is to go back
to non-SSL, how does one deliver the next page non-SSL because the current
link is under SSL?

Also, to add one more poker to the fire... the SSL site is NOT the same
site as the non-SSL site although they're on the same physical server.

Back And Forward With Sessions?
I am working on a website which is using sessions. What I want to do, is after the user is logged in, or logged out, when pushing the back or forward button not to change its current status(logged or not), if the destination page in history change this.

Problem With Back Button
On submitting a form a php script is called to validate the form. I did the validation with javascript code integrated in the php script. I know its not the proper way to do the validation but...

The problem is that if I dn't fill in the form..and click on the back button..the validation script is executed and i got an error message popup.I want the validation script to be executed only when I click on the submit button.Is this possible? But still I must use the form action so that I could retrieve the values in the validation script.

History Back Link
how do I create a history.back link with anchor, say #anchor? is there an easy way to do it with just: javascript:history.back(-2)#anchor or do i have to use php? i'm thinking i have to do something like onclick="<? some php code ?>#anchor" how do i grab browser history to redirect the user back two pages?

Back Tick Problem!
I have problem with following commands, code here....

$str=`php -v`;
echo $str;

it prints the output as

PHP 5.0.4 (cli) (built: May 9 2005 11:21:11)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

$str=`whois yahoo.com`;
echo $str;

No output is coming in browser; but when tried in terminal it shows the output of whois.

Back To Html Page From Php
How do you go back to the html page you came in from from inside a php
script?

Back To Previous Page?
is it a way that we can have "go back" to our previous page? cos normally when we use back command in our IE or NS. we should have this error message appeared Warning: Page has Expired blah blah blah..

so how should I program so that i can "go back" e.g: i got two php, fromhere.php and cominghere.php is there anyway that i can do in order to reach the page "fromhere.php"?

Back Button With Sessions
I have a set of pages that keeps track of the user by using sessions in PHP4. It works well with one major exception - using the back button produces a "Data Missing" error a lot of times.

Form Reset When U Go Back
How do i stop reseting form inputs..when u go back in the browser I use sesession before printing forms. Session is just check whether user is login or not if they login then redirect to member section if not show the form.

When you enter login information and if it is wrong .user need to go back and resubmit the login information. When u go back u need to type all information again which is just wasting time.

Back Button And Get Request...
I've made a script for managing shoppingcart (something like
cart.php?action=add&item=12345) and it works fine, the problem is: when user
hits the back button page after he added something in the cart, the add cart
script is rerun and he ends up with having 2 of the same item. Is there a
way to prevent script from running when accessed via back button?

Integer To Code And Back
I need to convert an integer to a unique code string consisting only of
capital letters and numbers.
I also need to be able to convert it back to an integer again.

Example:

10 =DFG56JKG4 =10

Back Up Mysql Db From Shell
I need to update a remote database from a local one. I use mysqldump in
my php page in order to create a file for each table, like this:

$command="mysqldump table_products > table_products.sql";
system($command);

This works perfect and it gives me a file with a drop-table,
create-table and all the insert values.

Then I need to connect to the remote server and run the
table_products.sql file.

The way I do that is by calling the following in my php page:

$command="mysql --host=$host --user=$user --password=$pass
--database=$db;";
system($command);

, where $host, $user etc are being set at the top of the page. This
works fine and I get connected to the remote database.

Now I need to run the following mysql command: source stb_products.sql

When I try this sequence from a command line (windows dos prompt), it
works perfect. When I
call "mysql --host=$host --user=$user --password=$pass --database=$db;"
in command line I get the "mysql>" prompt, and the run the "source
table_products.sql" and the remote database gets updated.

When I do this through PHP the last command doesn't work.

I guess I am not calling 'source' from within a "mysql" prompt?

How should I do it?

Any other ideas for achieving the same result? I need to do everything
from a single PHP page that runs on a local machine.

The full code is the following :

//DUMP DATA IN FILE
$command="mysqldump backcatalogue table_products > table_products.sql";
system($command);

//CONNECT TO REMOTE DATABASE
$command="mysql --host=$ohost --user=$ouser --password=$opass
--database=$odb;";
system($command);

//UPDATE REMOTE DATABASE FROM FILE
$command ="mysql source table_products.sql;";
system("command ") ;

Sessions And Back Button
I am developing a web site with a section only for registered users and
using sessions to control the access to these pages.
I have the problem with the "back" button of the browsers, especially
in IE.
When I go back within the controlled zone IE always display the message
"page expired" and mozilla displaying the advise that you are trying to
access to a post data page etc..

I am wondering if there is a way to avoid this "problem" a save the
users to think what to do when they see these messages, letting them to
go back and forth until they get out of the session.


Copyright © 2005-08 www.BigResource.com, All rights reserved