Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End php form refresh send form again (prevent)

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41868
    amis
    Participant

    when a form is filled and send, if you refresh the page, its says that the form will send again. (submit the form again).

    What is a good way to prevent this from happening? or kill this session?

    any guidance in this?

    thank you

    #120866
    amis
    Participant

    do u mean using meta refresh ?

    #120885
    __
    Participant

    No, an HTTP redirect. You can use the [header()](http://php.net/header) function to send http headers with PHP.

    This way, you can get the info from the form, store it (probably in your session), and then redirect to the same page to send your response. Since you never send a body response to the *actual* form submission, the user’s browser won’t store it in its history (and so, can’t submit the form again on refresh/back/etc.).

    #122263
    xfactor
    Member

    @amis traq said right method to prevent your issue

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.