No announcement yet.

Problem with browser caching

  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with browser caching

    I've been doing some PHP coding for fun and I've run inte some trouble with browser caching. At least I believe that is what is the problem.

    I have a login page that has a form with username and password. The action-attribute is set to the same page as the form. If the user enters the wrong username or password the script displays an error message and sais something like "Please press the back button and re-enter.", but when I press the back-buttom I don't go anywhere. I'm stuck on the same page as the error message. I have to refresh the page in order for my browser to realize that it's the page that was "before" the error message. I noticed that this doesn't happen with i.e. vBulletin so I though you guys might know something about it.

    I'm using Internet Explorer 6 btw.

  • #2
    can you show us the code you have?


    • #3
      If you put this at the very beginning of your file, it won't be cached:
      PHP Code:
      ("Cache-Control: no-cache, must revalidate");
      header("Pragma: no-cache");
      header("Expires: Wed, 01 Jan 1997 01:00:00 GMT");
      header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");


      Related Topics