RE: [PHP4BETA] session_register() in a function...again
| From: | Cristopher Daniluk | Date: | Fri, 04 Feb 2000 04:38:17 +0000 |
| Subject: | RE: [PHP4BETA] session_register() in a function...again | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-9778@lists.php.net to get a copy of this message | ||
Why don't you just have the variables dynamically instantiated if they don't
already exist via on session_register? that saves kludges and makes more
sense to the new user anyway...
----------------------------------------------
Cristopher Daniluk cris@dsnet.net
Technical Specialist MicroStrategy, Inc
----------------------------------------------
-----Original Message-----
From: Sascha Schumann [mailto:sascha@schumann.cx]
Sent: Thursday, February 03, 2000 1:20 PM
To: Dave
Cc: php4beta@lists.php.net
Subject: Re: [PHP4BETA] session_register() in a function...again
On Wed, Feb 02, 2000 at 08:44:59PM -0800, Dave wrote:
> Hi all,
>
> I saw the post about placing a session_register() in a function and about
> how the var that you want registered needs to be global...
>
> My question is, how much more global does it need to be than the
following?
>
> function check_something() {
> global $var_to_reg;
> if($something) {
> session_register("var_to_reg");
> }
> }
>
> I even set the var outside the function (in global scope) and tried
> registering it inside the function...to no avail.
>
> The above will NOT start a session and obviously not register the var. If
I
> place the code in the global scope it does.
>
> Any ideas?
Try a snapshot from <URL:http://snaps.php.net/>.
--
Regards,
Sascha Schumann
Consultant