Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:58:29+00:00 2026-05-10T18:58:29+00:00

I have a web page x.php (in a password protected area of my web

  • 0

I have a web page x.php (in a password protected area of my web site) which has a form and a button which uses the POST method to send the form data and opens x.php#abc. This works pretty well.

However, if the users decides to navigate back in Internet Explorer 7, all the fields in the original x.php get cleared and everything must be typed in again. I cannot save the posted information in a session and I am trying to understand how I can get IE7 to behave the way I want.

I’ve searched the web and found answers which suggest that the HTTP header should contain explicit caching information. Currently, I’ve tried this :

session_name('FOO'); session_start(); header('Pragma: public'); header('Expires: Fri, 7 Nov 2008 23:00:00 GMT'); header('Cache-Control: public, max-age=3600, must-revalidate'); header('Last-Modified: Thu, 30 Oct 2008 17:00:00 GMT'); 

and variations thereof. Without success. Looking at the returned headers with a tool such as WireShark shows me that Apache is indeed honouring my headers.

So my question is: what am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:58:30+00:00Added an answer on May 10, 2026 at 6:58 pm

    IE will retain form contents on a back button click automatically, as long as:

    • you haven’t broken cacheing with a no-cache pragma or similar
    • the form fields in question weren’t dynamically created by script

    You seem to have the cacheing in hand, so I’m guessing the latter may apply. (As mkoeller says, Firefox avoids this problem if the page is in the last few back clicks by keeping the page itself alive for longer than it’s on the screen. However this is optional, and Firefox will revert to the same behaviour as IE and other browsers once you’ve browsed a few pages ahead and it has expired the old one.)

    If you’re creating your own form fields from script onload, then the browser has no way of knowing that the new input control is ‘the same’ as the old instance, so it can’t fill it in with the previously-submitted value. In this case if you want it to play well with the back button you have to start storing data on the client.

    Then you have to use some sort of state-keying so that each set of data is tied to exactly one instance of the page, otherwise going through multiple instances of the same form or having two browsers tabs open on the form at once will severely confuse your script.

    And then you are starting to collect a lot of data if they’re big forms, and if the client-side storage mechanism you’re using is cookies you can start to lose data, as well as sending a load of unnecessary state nonsense with every HTTP request. Other client-side storage mechanisms are available but they’re browser-specific.

    In short: doing dynamically-generated forms nicely is a huge pain and it’s probably best avoided if you can. Having a hidden form on the page that a script makes visible, thus allowing browsers to do their field-remembering-magic instead of giving you the task, is typically much easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The two tools use the same common VS implementation for… May 11, 2026 at 10:10 am
  • added an answer You can use the Graphics.DrawImage to resize the image. Then… May 11, 2026 at 10:10 am
  • added an answer C# programming + asp.net is clearly part of .net programming.… May 11, 2026 at 10:10 am

Related Questions

I have a web page x.php (in a password protected area of my web
I have a web page that includes a bunch of images. Sometimes the image
I have a web page which contains a select box. When I open a
I have a web page in which people go to register for my site.
I have a web page with DIV s with a mouseover handler that is
I have a web page that displays a long line graph inside a div
I have a web page that is being displaying in a winform app using
I have a web page with 3 forms on it. Not nested, just one
I have a web page where it will input an excel/CSV file from the
I have a web page where the user will enter their address. They will

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.