Thread: Grrr Functions
View Single Post
Old 03-10-2008, 06:18 PM   #1 (permalink)
Gareth
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default Grrr Functions

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
Gareth is offline  
Reply With Quote