Reputation: 169
I have a form on a page (form.php) that when submitted uses submit.php to send the data to my email address. submit.php then redirects to info.php. On info.php I want to include some of the data the user entered into form.php. The user will enter additional inputs on info.php and then submit it.
info.php will then use another php page to email me the form inputs. The form inputs will include those from form.php and those the user input on info.php.
Wow, I hope that makes sense. To summarize:
form.php --> submit.php (hidden - emails me form data) --> info.php (carry some inputs from form.php to here, user will also input additional data) --> emailed to me again with another php page
I am not posting the code as it's very long and I think you can all imagine how it looks. But to help:
form.php - simple form with inputs
submit.php - data from form.php POST here, sends to my email
info.php - simple form with inputs
Thanks in advance!
Upvotes: 0
Views: 520
Reputation: 585
The easiest thing to do from submit.php is to set session data
$_SESSION['name'] = array('myInput'=>$_POST['myImput']);
Then after everything is set:
header('location: info.php');
in info.php
<?php
session_start()// almost forgot call this at the top of submit.php and info.php first
and access your session data:
echo $_SESSION['name']['myInput'];
on a side note, I would look at using AJAX from the form.php to the submit.php and have submit return a complete or fail status. Then carry the form data you want from there to info.php
Upvotes: 1