PHP header() redirect with POST variables [duplicate]

This question already has an answer here:

I'm working with PHP, and I'm making an action page which a form posts to. The page checks for errors, then if everything is fine, it redirects them to the page where the data has been posted. If not, I need to to redirect them back to the page they were at with an error and the POST variables. Here is the gist of how it works.

The HTML would look like this...

action.php would look like this...

if(error_check($_POST['one']) == true){
    header('Location: form.php');
    // Here is where I need the data to POST back to the form page.
} else {
    // function to insert data into database
    header('Location: posted.php');
}

In the case of an error, I need it to POST back to the first page. Я не могу использовать GET, потому что ввод будет слишком большим. Я не хочу использовать SESSION, если это возможно. Это возможно?

47
задан ashkufaraz 12 November 2016 в 15:25
поделиться