Re: session vars with recursive form
| From: | bill | Date: | Fri, 12 Jan 2001 19:47:08 +0000 |
| Subject: | Re: session vars with recursive form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34289@lists.php.net to get a copy of this message | ||
O.K., this seems to work:
-------------------
$thevals=array(alpha,beta,gamma,delta,epsilon);
while (list($key, $val) = each($thevals)) {
if ($HTTP_POST_VARS["$val"] && (!session_is_registered("$val"))) {
session_register("$val");
}
}
-------------------
bill wrote:
> How can I correctly register session vars on a recursive form?
>
> If I call a page repeatedly using:
>
> <FORM ACTION="<?php echo $PHP_SELF ?>" METHOD="POST">
>
> The earlier variables keep getting lost.
>
> How can I register the session variables correctly? Each subsequent
> page should set its own variable while remembering all those previously
> set.
>
> Right now the top of the page says:
>
> -----------
> session_start();
>
> $thevals=array(alpha,beta,gamma,delta,epsilon);
> while (list($key, $val) = each($thevals)) {
> if (!session_is_registered($val) ) {
> session_register("$val");
> }
> }
> ----------
>
> thanks,
>
> bill
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net