RE: [PHP] Require()

From: Date: Wed, 26 Jun 2002 13:11:16 +0000
Subject: RE: [PHP] Require()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-103951@lists.php.net to get a copy of this message
> 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 (#103951) next »