newbie
newbie

Reputation: 129

document expired after pressing back button

I have a page called a.php . It has a form and submit data via POST to same file (a.php) . Page loads with no error. Then I click any link (b.php or b.html) on that page . it directs to any page as usual. Then when I click back button from b.php or b.html it does not show previous page.

Any help to solve this matter ?

Thanks

Upvotes: 2

Views: 3303

Answers (2)

Maninderpreet Singh
Maninderpreet Singh

Reputation: 2587

About Method

The $_POST Method used for SUBMITTING FORMS something Create or Modify it is a secure method.In other words POST is sending data to server from browser

FOR EXAMPLE

  • Creating Articles
  • Editing Articles
  • File Uploading

In your case you are getting values POST is not for getting values Use $_GET method for this

Why Document Expires ?

I taken this Image from wikipedia.

enter image description here

Why Browser Do this?

It is because it prevent from duplicate submission.

For Example : On any shopping site there are payment options user buy a product and pay for it , now if he/she(user) refresh page again the payment done two times .

Upvotes: 1

Kotomono
Kotomono

Reputation: 78

according to your question, page a.php is submitting data (post) to the page itself, so if you go to other page and then want to back again to page a.php (by clicking the back button on browser) it causes document expired because when you click it you are not submitting any data (post) to page a.php.

Upvotes: 0

Related Questions