Re: http_get_var and isset() not working with script generated includes.
| From: | rija | Date: | Mon, 18 Nov 2002 21:39:01 +0000 |
| Subject: | Re: http_get_var and isset() not working with script generated includes. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124981@lists.php.net to get a copy of this message | ||
Yep,
You need make global every variable used in yout include.
Maybe, you should declare-
GLOBAL $_GET ;
or do not call function to include your include
just do simply like this,
foreach ($sections as $key => $value) include "mod.section." . $value .
".php";
----- Original Message -----
From: "Moo" <remi2402@hotmail.com>
To: <php-general@lists.php.net>
Sent: Friday, November 15, 2002 7:55 AM
Subject: [PHP] http_get_var and isset() not working with script generated
includes.
> I wrote a bug report but dereck@php.net 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
>
>