Re: Re: Best Way to Pass Variables between PHP files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alan Schneider wrote:
> I tired sending via name-value pairs with the following but it did not work
> 
> require (DIR_WS_INCLUDES . 'filenames.php?lv_user_id=$user_id');
> 
> "DIR_WS_INCLUDES" is a defined constant and filenames.php is NOT a web page; 
> just a php file that sets the file names to be used in the application.
> 
> Is there a way I can do it with include or require?
> 

Include and require files share the same variable space as the parent
file.  You can think of it as being the same as copy & pasting the text
directly into the same file.

Hence, $user_id is available in filenames.php, just call as you would in
the parent file.


David

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux