I think that you need to call the checkMaster() function AFTER you declare
it, not before. Try moving "checkMaster();" beneath the function
definition.

Mick


On Sun, 21 Jul 2002, Jon Wyatt wrote:

> 
> I have some pages which include a number of files.
> In one of the include files I have a function which I wish to be executed 
> everytime the include file is loaded.
> 
> Therefore I place the function name in the include file at the top.
> 
> However, this function uses a session variable to decide whether to call 
> another function and it appears that this variable is not being carried 
> across. For example, the start of the include file might look like this:-
> 
> 
> <?php
> 
> checkMaster();
> 
> 
> function checkMaster()
> {
>         global $master_session;
>         if ($master_session[db_host])
>         {
>                 connectToDB();
>         }
> }
> 
> 
> function connectToDB()
> {
>       ...
>       ....
> 
> 
> The master_session variable is not set and hence connectToDB is never 
> called.
> If I place the checkMaster code in each page that includes this file then it 
> all works fine. How do I get round this?
> 
> Thanks.
> 
> jon.
> 
> Better than having your body rubbed vigorously with a cheese grater.
> http://www.samuri.co.uk.
> 
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> 
> 

-- 
--------------------------------
n   i   n   t   i  .   c   o   m
php-python-perl-mysql-postgresql
--------------------------------
Michael Hall     [EMAIL PROTECTED]
--------------------------------


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

Reply via email to