Re: Forms & PHP
| From: | Greg Wiley | Date: | Wed, 02 Jul 2003 13:58:39 +0000 |
| Subject: | Re: Forms & PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153708@lists.php.net to get a copy of this message | ||
On Wed, 2 Jul 2003 14:45:27 +0100, Gary Ogilvie <gary.ogilvie@wbpdata.com> wrote:
[snip] By maintaining the POST (assuming you're using POST)variables and calling them into the form values when reloaded. If you go to the second page store the POST variables in hidden form input types, then grab them when the second page is POSTED. Does this make sense? Not enough caffeine for me yet...[/snip] So basically I need to have 2 versions of the first page, is that right? :) No, in your first form you have code like<?php if ((!isset($_POST)) || (!isset($_POST['foo']))) { $foo = <set default value here>; } else { $foo = $_POST['foo']; } ?> <form method="post" action="form2.php"> <input type="text" name=foo value="<?php echo $foo;?>" /> ... </form> and in the second form you have: <form method="post" action="form1.php"> <input type="hidden" name=foo value="<?php echo $_POST['foo'];?>" /> ... </form> Cheers, Greg. -- Greg Wiley www.wileysworld.org