Re: is this syntax correct?

From: Date: Thu, 05 Apr 2001 06:43:59 +0000
Subject: Re: is this syntax correct?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47190@lists.php.net to get a copy of this message
Re-arrange the code. <?php session_register("$test"); $test = "foo"; ?> Always use session_register first, then follow it with assigning the variable a value. May not be required in the future, but do it anyway for clarity. I don't think you need the global line at all. global is used inside of functions and classes, not in an "non-nested" piece of code. -- Plutarck Should be working on something... ...but forgot what it was. ""Jacky"" <jacky@activelifestyle.com> wrote in message news:004001c0bbb3$bada9080$6400a8c0@activelifestyle.com... Hi all is this syntax correct to work on session in php4? <?php global $test; $test = "foo"; session_register("$test"); ?> but nest page when I call variable $test to echo it, nothing come up? what did I do wrong? Jack jacky@activelifestyle.com "There is nothing more rewarding than reaching the goal you set for yourself"

« previous php.general (#47190) next »