Re: globals off in function

From: Date: Tue, 14 Jan 2003 12:59:29 +0000
Subject: Re: globals off in function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-131539@lists.php.net to get a copy of this message
in function i call to $smarty variable " function showLoginForm(){
       global $db, $smarty; // $smarty = new Smarty in main code
Fatal error: Call to a member function on a non-object in
Are you sure $smarty = new Smarty is in the main code? Can it be in another function? Try setting global $smarty; just before you create $smarty. Does that help?
( register_globals = off ) Imho, globals don't working with "globals off", nut i can't find this in manual. no, register_globals is only about the automatical production of variables from FORM, GET and other data input.
But i fully agree the name is confusing.

« previous php.general (#131539) next »