In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Hello,
> 
> I created a librairy with configuration setting: background color, font size, 
> customer's name, etc. Like this:
> (lib_config.inc)
> 
> $bgcolor = "#ffffff";
> $co = "ABC enterprise";
> 
> A second file is building html page headders:
> (lib_intra.inc)
> 
> function title($name_section,$name_page){
> print "<br><br>\n";
> print font_titre3."$co</font><br><br>\n";
> print font_titre2."$name_section</font><br>\n";
> print font_titre2."$name_page</font>\n";
> print "<br><br>\n";
> }
> 
> Finnaly, I call the title function in a web page to dynamicly create the code:
> (test.php)
> 
> echo title("General presentation","The annual report");
> 
> My problem (you guessed it!) is that the file lib_intra.inc is beeing processed 
> by php (when callled by my web page test.php) and the 2 variables are sent ok 
> but NOT the $co wich is in the 1st file (lib_config.inc). Of course my 
> lib_intra.inc has a: require ("lib_config.inc");
> 
> Because I dont want to duplicate infos that are used in many files, the 
> lib_config.inc is important and must be called to supply the data I need.
> 
> How can I set this so all the variables will be process under php?
> 
> Thanks to all!
> 

You are trying to access the value of $co in a function; you'll need to 
declare it as a global value within the function or pass it to the 
function as a parameter.

-- 
David Robley
Temporary Kiwi!

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

Reply via email to