You can save this data in a session, for example. in the first file that processes the message
session_start(); $_SESSION['formdata'] = $_POST;
then you can read it on the next page, for example
session_start(); print_r($_SESSION['formdata']);
or you can pass it via GET: (but commenting is a bad idea)
header('Location: page.php?' . http_build_query($_POST));
If you do this, make sure that you do additional processing / validation on the .php page, as a malicious user can modify the variables. also, you may not need all the mail sent to the next page
Edit
I must clearly indicate that, in my opinion, the second option is worse, since you are limited by the size of the data that you can send via get, and perhaps less secure, since users can manipulate the data more explicitly.
Tom haigh
source share