veraction
January 23rd, 2006, 11:46 PM
Currently, I have a form which consists of 2 steps:
Fill out form & click submit
Form's input is displayed & then it is processed
I'd like to make it a 3 step process:
Fill out form & click submit
Output the user's input and have a verify button (so if they screwed up they can go back)
process form input
Say I have a form in 1.html:
<form action="2.php" method="post">
Name: <input type="text" name="username" /><br />
Email: <input type="text" name="email" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
then 2.php looks like this:
<?
$username = $_POST[ 'username' ];
$email = $_POST[ 'email' ];
echo "<h2>Verify: </h2>";
echo "Username: $username<br>";
echo "email: $email";
echo "<form action = \"3.php\" method = \"post\" >
<input type = \"submit\" name = \"complete\" value=\"complete\" />
</form>";
?>
Now, how would I go about getting the $username and $email variables in 3.php? -- not using 3.php?username=x&email=y (cause form may have lots of text)
2.php & 3.php could be combined into one file if needed, but I still can't figure it out then. I can use isset( $_POST[ 'complete' ] ) to check if the 'complete' button was pressed, but can't access the email & username fields.
I'd prefer to remain compatible with different browsers & settings. So, no javascript or cookies
Fill out form & click submit
Form's input is displayed & then it is processed
I'd like to make it a 3 step process:
Fill out form & click submit
Output the user's input and have a verify button (so if they screwed up they can go back)
process form input
Say I have a form in 1.html:
<form action="2.php" method="post">
Name: <input type="text" name="username" /><br />
Email: <input type="text" name="email" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
then 2.php looks like this:
<?
$username = $_POST[ 'username' ];
$email = $_POST[ 'email' ];
echo "<h2>Verify: </h2>";
echo "Username: $username<br>";
echo "email: $email";
echo "<form action = \"3.php\" method = \"post\" >
<input type = \"submit\" name = \"complete\" value=\"complete\" />
</form>";
?>
Now, how would I go about getting the $username and $email variables in 3.php? -- not using 3.php?username=x&email=y (cause form may have lots of text)
2.php & 3.php could be combined into one file if needed, but I still can't figure it out then. I can use isset( $_POST[ 'complete' ] ) to check if the 'complete' button was pressed, but can't access the email & username fields.
I'd prefer to remain compatible with different browsers & settings. So, no javascript or cookies