Duh, really, and just read on varianle scopes on
php.net. Gotta to sleep for some time :)
--
Tadas Talaikis
[EMAIL PROTECTED]
http://www.xongoo.com
- Original Message -
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Xongoo!com: Central unit" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, August 29, 2004 11:41 AM
Subject: Re: [PHP] Passing variable on include
> Xongoo!com: Central unit wrote:
> > Hi,
> >
> > I have to pass variable on include
> > include("includes/include.php");
> >
> > include("includes/include.php?name=$name");
> > wouldn't work.
> >
> > How do I do that? Cokies are not an option,
btw.
>
> Code in includes/include.php is executed in the
scope of the including
> file, so all variables available at the
include() will be available in
> the included file. Thus the solution is:
>
> $name = 'Your Name';
> include("includes/include.php");
>
> --
> 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