1

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

3
  • This is not a javascript problem, but php ;) Commented Mar 2, 2011 at 10:36
  • @Xavinou this is not PHP problem, but HTTP Request ;) Commented Mar 2, 2011 at 10:38
  • Why cant u use the Clear property of the controls when ever the click happens on the send button, after sending the form. Commented Mar 2, 2011 at 10:38

3 Answers 3

3

After processing the POST informations, do a

header('Location: your_url');
exit();
Sign up to request clarification or add additional context in comments.

1 Comment

I vote for this solution, but sometimes its hard to implement.
1

You can use AJAX to send POST variables to server, so refreshing browser window problem will not be a problem.

Comments

0

If you keep displaying the form there is no reason to prevent this.

Otherwise - i.e. after the form has been submitted successfully - store any messages you need to display in your session and then redirect to whatever page you want to display. This ensures the user is moved away from the POSTed page.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.