Re: globals off in function

From: Date: Tue, 14 Jan 2003 14:16:16 +0000
Subject: Re: globals off in function
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-131565@lists.php.net to get a copy of this message
Chris Hayes <chayes@antenna.nl> ïèøåò â ñîîáùåíèè:5.1.0.14.0.20030114135652.02049c10@pop4.antenna.nl... > > >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? Thanks, that's nice 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 (#131565) next »