Facing Problem after form posting with browser's back button

Discussion in 'PHP' started by VishalVasani, Sep 12, 2007.

  1. #1
    Hello,

    I am using php and posting data using html form post method. I am facing problem with browser back button (page expires). I donot want to us html form get method. Any one has solution to this problem.
     
    VishalVasani, Sep 12, 2007 IP
  2. m0nkeymafia

    m0nkeymafia Well-Known Member

    Messages:
    399
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    125
    #2
    do you mean that once a form is posted, and then a user presses the back button it re-submits it?

    what you need to do is after the page has been submitted and the form dealt with user header("location: newpage.html"); to redirect the user back to the same page [or another].

    this gets around that problem easily.
    note to use header you must not have output anything already unless you use object caching in php

    hope this helps
     
    m0nkeymafia, Sep 12, 2007 IP