Reputation: 438
I have only been able to do this with GET, How do I submit multiple forms without the previous data being lost when resubmitting a different form via POST ?
Upvotes: 2
Views: 492
Reputation: 26431
Take your previous data in session array.
Or you can post your data again using hidden fields in your form.
Upvotes: 3
Reputation: 6943
This code should loop through all POST and insert them into a hidden input field. Put it inside the <form>
tags, and it should be submitted with the subsequent post.
Remember to properly escape the output.
foreach($_POST as $name => $value){
echo '<input type="hidden" name="'.$name.'" value="'.$value.'" />';
}
Or you can save away the data in the manner you choose.
Upvotes: -1
Reputation: 5316
Use hidden input fields?
<input type="hidden" />
Store in a session?
session_start();
$_SESSION['blarr'] = $_POST['old-data'];
Upvotes: 5