Jump to content

info from one page to another...


Codeman0013

Recommended Posts

My delima is i have a page that is not using a database its just pure php and i have a php mailer page but before it mails to the person i want it to take all the information from the page and submit it to a page that will display all they typed in so they can click ok to have it mail or cancel to edit it also can i put the mailer page stuff on the page so if they click ok it will submit the mailer info i have???

Link to comment
Share on other sites

You can do this. You will need 2 pages. The first page is your form. They fill out the info, and hit submit. The first page will also eventually be responsible for sending the email. The second page will get all of the information, display it, and then create another form. The new form will only contain hidden fields, it won't have anything editable. So the HTML may look something like this:

Your name: John SmithYour age: 40Your job: Assassin<form action="page1.php" method="post"><input type="hidden" name="name" value="John Smith"><input type="hidden" name="age" value="40"><input type="hidden" name="job" value="Assassin"><input type="submit" name="submit" value="Send Email"><input type="submit" name="submit" value="Edit Info"></form>

So, the form has all the information they just sent, plus two submit buttons, and will submit back to page 1. Page 1 will check which button they pressed:

$action = $_POST['submit'];if ($action == "Send Email"){  //get everything out of $_POST, and send the email}if ($action == "Edit Info"){  //get everything out of $_POST, and re-display the form with the information filled in}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...