Re: Include / Require

From: Date: Thu, 05 Apr 2001 18:25:25 +0000
Subject: Re: Include / Require
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47303@lists.php.net to get a copy of this message
Lindsay Adams wrote: > So, leaving out the table=$table will still result in $table being defined > by the code prior to the include. Actually, the the I'm trying to include has several segments in it, which depend on which table was just queries. It basically looks like this: if (table_1) { return this set of variables } elseif (table_2) { return this other set } elseif (table_3) { return these ones } else { echo "you bonehead, you didn't include a table!"; } You're saying, if I just include 'variables.inc', it will know what $table is (from the main script) and would run through that routine fine? Actually, it makes sense, all it does is include it as if I wrote it in the main script. Okay, so how can I make it so I only get the variables returned, as opposed to it including the whole bit in the main script? (kinda like the way a function() with a return $var in it would work.) AMK4 -- W | | I haven't lost my mind; it's backed up on tape somewhere. |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:ashley@pcraft.com> . 303.442.6410 x130 SysAdmin / Websmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave #6 .................. . . . . Boulder, CO 80303, USA

« previous php.general (#47303) next »