Hi
I have a config file,
conf_global.php with all sorts of settings and variables. The one I am interested at the moment is
$siteName = 'A Site Name';
I include
conf_global.php on every page.
I also, in this file, link to
core.func.php, which is a file with all my functions in it.
I have a function, called
title():
PHP Code:
function title( $sitename, $page ){
echo '<title>' . $sitename . ' - ' . $page . '</title>';
}
Which I refer to, to make the <title> tag easily. I assumed, that because
$siteName has been defined in the
conf_global.php, that to make it work all I had to do is:
PHP Code:
<?php
title( $siteName, 'Home');
?>
However it doesn't work; I have to use this instead:
PHP Code:
<?php
$site = $siteName; // Needed, for now...
title( $site, 'Home');
?>
Is there a way I can use the title function to use a variable (siteName) defined in conf_global.php?
Gareth