Re: Require()

From: Date: Wed, 26 Jun 2002 13:21:19 +0000
Subject: Re: Require()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-103959@lists.php.net to get a copy of this message
Thanks, that worked, and made it alot clearer. Andy "John Holmes" <holmes072000@charter.net> wrote in message news:000501c21d12$f4907580$b402a8c0@mango... > > if ($viewsystem = = 1) > > $Str = "editexemptfiles.php?every = 1"; > > > > require($Str); > > You don't pass variables to a require()'d file. Any variable in the > current scope is available in the included()'d, require()'d file. > > So just require($editexemptfiles.php); and in that file, $every will be > available, automatically. > > Think of include() and require() as a cut and paste operation. When you > use either function, it's just like taking that file and copying it into > the code at that point. So anything available to the main script at that > point is available to the included/required file. > > ---John Holmes... >

« previous php.general (#103959) next »