session_register in function - addendum
| From: | Jon Rosenberg | Date: | Sat, 24 Feb 2001 16:33:22 +0000 |
| Subject: | session_register in function - addendum | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41493@lists.php.net to get a copy of this message | ||
The code snippet below is from a file that is the post action of a login
form
the login form also has session_start();
----- Original Message -----
From: "Jon Rosenberg" <php@columbusinteractive.com>
To: "PHP List" <php-general@lists.php.net>
Sent: Saturday, February 24, 2001 11:16 AM
Subject: [PHP] session_register in function
> The variable I register before the function becomes available in the
session
> to other pages...the variable I register inside the function are not
> accessible in the session to ohter pages. Is this normal? How can I work
> around this? Thanks! PHP4.0.4pl1 on Linux.
>
> sample code:
>
> <?
> session_Start();
>
> $foo = "bar";
> session_register("foo");
>
> function bob($user){
> $username = $user . "one";
> $username2 = $user . "two";
> session_register("username");
> session_register("username2");
> return true;
> }
> ?>
>
>
> --
> 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
>