Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with a form

Status
Not open for further replies.

rjseals

Technical User
Nov 25, 2002
63
US
I have an html form that will pass data to a php file that will update my mysql database. It works fine but I want to first have a confirmation page so they can check there info before they submit it. My question is how can I get the variables to the third page. I know how to pass then from the first to the second:


//firstpage.php
<form method = &quot;post&quot; action = &quot;secondpage.php&quot;>

first_name
last_name
etc
</form>


Like I said I know how to get them from the first to the second page

//secondpage.php

$firstname = _POST['first_name'];
$lastname = _POST['last_name'];
ect

now in the secondpage.php I just print out what they put in the form to confirm but I would like to know how to pass the variables with info (first_name, last_name etc) into the thirdpage.php. so I can actually update the database (which I know how to do ).

Thank you
 
Why not make the items on the second page hidden items too?

ie:

<form method=&quot;post&quot; action=&quot;nextpage.php&quot;>
<input type=&quot;hidden&quot; name=&quot;first_name&quot; value=&quot;<? echo $firstname; ?>&quot;>
[etc etc]
<input type=&quot;submit&quot;>
</form> --
Jon
 
If your're not using a form between the second page and third, you could use a manual GET string:
Code:
<a href=&quot;thirdpage?first_name=<?php echo $first_name; ?>&quot;>
or:
Code:
header(&quot;Location: thirdpage.php?first_name=&quot;, $firstname);
.:TUCK:.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top