id like to know if there is anyway to carry information from one page to another. if i wanted to collect someone's name and email on one page and have them click submit, and then take them to another page with some more fields but not force them to re enter that info.
thanks
seth
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Seth,
the answer is PHPSESSION variables. embed php code at the top of each page like this. (both the html and php files)
<?php
session_start();
foreach($_POST as $key=>$value){
$_SESSION[$key]=$value;
?>
then from the next page, you can access the data. for instance, if on the first page you had a text box named Account, you could populate the Account text box on the second page like this:
It is also possible to do this without sessions but it up to you to decide how you want or need it done.
Without sessions you would treat each new page as a processor for the previous page. You can then carry previous page values by prepopulating new fields on a new version of the form or by populating hidden variables to be carried forward to the next page after clicking the next submit button.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hello,
id like to know if there is anyway to carry information from one page to another. if i wanted to collect someone's name and email on one page and have them click submit, and then take them to another page with some more fields but not force them to re enter that info.
thanks
seth
Hi Seth,
the answer is PHPSESSION variables. embed php code at the top of each page like this. (both the html and php files)
<?php
session_start();
foreach($_POST as $key=>$value){
$_SESSION[$key]=$value;
?>
then from the next page, you can access the data. for instance, if on the first page you had a text box named Account, you could populate the Account text box on the second page like this:
<font face="Verdana"><input type=text name='Account' size=20 value="<? echo $_SESSION['Account'] ?>"></td></tr>
Once again, embedding php code into the html.
See this man page:
http://us3.php.net/session
I just finished up a multiple page form were I did just that.
Hope this helps.
Dave
It is also possible to do this without sessions but it up to you to decide how you want or need it done.
Without sessions you would treat each new page as a processor for the previous page. You can then carry previous page values by prepopulating new fields on a new version of the form or by populating hidden variables to be carried forward to the next page after clicking the next submit button.