Copy and pasted from the PHP manual:

"If the include occurs inside a function within the calling file, then all
of the code contained in the called file will behave as though it had been
defined inside that function. So, it will follow the variable scope of that
function."

So in other words any script you include inside the function LoadSections()
will be local to that function.

-Kevin

----- Original Message -----
From: "Moo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 14, 2002 1:55 PM
Subject: [PHP] http_get_var and isset() not working with script generated
includes.


> I wrote a bug report but [EMAIL PROTECTED] bogusified my report without the
> least bit of information.
> My script uses multiple includes and the file names all have the same
> syntax. So instead of writing each individual include, I created an
> array which contains all the filenames
>
> function LoadSections($sections)
> {
>  foreach ($sections as $key => $value)
>  {
>   include "mod.section." . $value . ".php";
>  }
> }
> instead of writing
> include file_x;
> include file_y;
> and so on
>
> All the files load well except that I cannot access HTTP_GET_VARS and
> the isset() function always return false (when they are inside the
included
> files).
>
> NB My includes work fine when loaded individually
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to