I have a form on page 2 and I want the information submitted on the form to be sent to page 3. How do i do that?
skald89
2
Unverified User
Recommended Answers
Jump to PostYou can save it onto a $_SESSION variable. Assuming that on page1.php you are submitting a POST request (as opposed to a get), then on page2.php:
<?php session_start(); foreach($_POST as $fieldName=>$value){ $_SESSION[$fieldName]=$value; } ?>
Then on page3.php
<?php session_start(); //for the sake of clarity, …
Jump to Postpage 1 and page 2 are .html not .php files. does that make a difference?
Yes. They must be PHP files.
this the form I am using
That is NOT a form. What you have are TWO forms. The submit button applies ONLY to the second form, so you will …
Jump to PostSo i tried it, I made 3 new files with the names you said to test it.
page1.php
sendresults.php
emailIt.phpOK, but did you change the
action
attribute on the<form>
. If you left<form action="php/sendresults.php" id="email" method="post">
it will not work. Assuming you created all those new files …
Jump to Postwhy would we make the person fill out another form?...Im just really lost, why there are 3 pages for this code?
Your ORIGINAL problem description was:
I have a form on page 2 and I want the information submitted on the form to be sent to page 3. How do …
Jump to PostOK, then basically all you need is file1.php and emailIt.php. Just make sure that in file1.php you use
<form action="emailIt.php" method="post">
All 27 Replies
hielo
65
Veteran Poster
skald89
2
Unverified User
skald89
2
Unverified User
hielo
65
Veteran Poster
skald89
2
Unverified User
hielo
65
Veteran Poster
skald89
2
Unverified User
hielo
65
Veteran Poster
skald89
2
Unverified User
hielo
65
Veteran Poster
skald89
2
Unverified User
hielo
65
Veteran Poster
skald89
2
Unverified User
hielo
65
Veteran Poster
skald89
2
Unverified User
hielo
65
Veteran Poster
Rashmi R
0
Newbie Poster
skald89
2
Unverified User
hielo
65
Veteran Poster
skald89
2
Unverified User
ana10192000
0
Newbie Poster
skald89
2
Unverified User
skald89
2
Unverified User
hielo
65
Veteran Poster
skald89
2
Unverified User
skald89
2
Unverified User
skald89
2
Unverified User
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.