Possible duplicate:
PHP header () redirects POST variables
I am writing a script where form data is sent to another script. I want the second script to do some error checking on the presented data $_POST, and if everything is ok, process the data. If the data has errors, I use header('Location: http://www.example.com/script.php');to return the visitor to the form page.
The problem I'm facing is that I want the form to be sticky - fields with the correct data saved the values that the user entered into them. Obviously, to get these values, I need access to the array $_POST. However, this seems to be ruined when the call header()redirects the visitor back to the form.
Is there a way to use the Location stuff header to redirect the visitor to another page, while preserving the data $_POST?
Now I use it like this: header('Location: http://www.example.com/add.php?id='.$id.'&name='.$name.'&code='.$code.'&desc='.$description.'');and access as $_GET.
For the same, you can use the POST view in header('location: xxx')?
Vijay source
share