Re: [Phplib-users] Next auth issue, php variable scope issue
Brought to you by:
nhruby,
richardarcher
From: Michael C. <mdc...@mi...> - 2002-10-14 03:55:37
|
On Sun, Oct 13, 2002 at 01:48:23PM -0400, Rob Hutton wrote: > This does not seem to be an auth issue per say, but maybe Gian or someone > can help. Here is my app structure > > index.php (wrapper page) -> instantiates sitePage (Object that does the > work) > > sitePage has several functions that are called to process a template. If I > put the page_open inside one of those functions, then the sess, auth, etc > variables never show up in $GLOBALS. If I move the page_open to index.php, > then I get them in $GLOBALS correctly. This is one of the reasons that I removed the "includes" when I wrote phpauth and simply made the header and footer into functions. No question about scope, it's not global so you're forced to specify if that's what you need. It's as easy when using phplib, particularly with php4, simply make sure that everything is explicitly $GLOBALS['varname']. Michael -- Michael Darrin Chaney mdc...@mi... http://www.michaelchaney.com/ |