Re: require_once(); questions

From: Date: Sun, 08 Jul 2001 01:53:36 +0000
Subject: Re: require_once(); questions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-56708@lists.php.net to get a copy of this message
I guess I know what may be wrong. My function that includes the files, it is called several times, with different arguments being passed. It is something like: function LoadPositionedModules ($posv, $posh) { // $posv is vertical position, and $posh is horizontal position // Inside it, something like: SELECT file_to_include FROM table WHERE posv = '$posv' AND posh = '$posh'; // Then the fetch_array, include, etc... } So if I call: LoadPositionedModules ('Left', 'Center'); And it includes files feeding the SQL. On this included file I define a var: $test = "Show Me!"; If I call again, but with different parameters: LoadPositionedModules ('Left', 'Footer'); Then I guess the problem is that I can't use the $test var from the first included file. It's clear to me why I can't now, thanks. So I believe a solution would be to find out how to use this var outside the function scope. That was my second question.. Anyone have any ideas? I guess I could register it on a session, or return it... -- Julio Nobrega. Yes, I am developing another 'Portal-System' Have a look: http://sourceforge.net/projects/toca

« previous php.general (#56708) next »