Re: globals off in function

From: Date: Tue, 14 Jan 2003 12:14:34 +0000
Subject: Re: globals off in function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-131537@lists.php.net to get a copy of this message
On Tuesday 14 January 2003 18:46, Michael Bevz wrote: > I've such trouble: > ( register_globals = off ) The register_globals setting in php.ini has ... > in function i call to $smarty variable > " > function showLoginForm(){ > > global $db, $smarty; // $smarty = new Smarty in main code ... nothing to do with the 'global' statement. > $smarty->assign("message", $message); // !!!! > " > and i receive this error message > " > Fatal error: Call to a member function on a non-object in > /usr/home/elastic.org/work/svyatoshin/system/common_func.php on line 22 > " > Who can help me? Assuming line 22 is (it would help if you told us _which_ is line 22) $smarty->assign("message", $message); and assuming that you _really_ have defined $smarty in the main code then I cannot see what you're doing wrong. Does $smarty->assign("message", $message work in the main loop (ie when not in a function)? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* In Oz, never say "krizzle kroo" to a Woozy. */

« previous php.general (#131537) next »