Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirect header and post data

Status
Not open for further replies.

mistergoomba

Programmer
Apr 10, 2006
9
US
I have a form 'form.php' which sends post data to 'actions/form.php' which then processes the information and uses header("Location: ../form.php"); exit; to return to the form after the script has executed.

The problem is, when the user is returned to form.php and hits 'Refresh' or 'Reload', the pop up saying 'The page you are trying to view contains POSTDATA'. Is there a way I can dump post data in the form.php header?
 
No. Post-method data can only be sent from the browser to the server. It doesn't work the other way.

I recommend instead that you use session variables to store what you need to keep track of.


Want the best answers? Ask the best questions! TANSTAAFL!
 
ok, let me clarify the question.

i after the form data is sent to 'actions/form.php' i use 'header(Location: ../form.php)' to return to the original form.

now, when the user is back at the original form (or any page that i redirect to for that matter) and hits reload, it will try to send the form data again.

i DO NOT want to keep the data and have it sent again. the question is how do i make sure that the form data is not being sent again.

(i think i used the word 'dump' in the wrong context in my original question)
 
In that case, my answer is, well, use session variables.

Set a session variable that says a particular form has already been submitted. If that form is submitted again, ignore the input or display an error rather than processing the data.


Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top