I have an include file named functions.inc.php that I include in nearly
every script. For some bizarre reason, the following function inside this
file does not always work:

function user_acess() {
    if ( isset($_SESSION['valid_user']) ) {
        return 1;
    }
    return 0;
}

Most of the time it returns 0 (zero) even though I know the session variable
is set. However, if I rename the functions.inc.php file to functions.php and
make NO changes at all to the code, it suddenly works!? In fact, it seems
that if I rename the include file to anything but functions.inc.php, the
above function works as expected, returning 1 instead of 0. I tried
functions2.inc.php, funct.inc.php ... they all worked.

What the hell is going on here? How could the name of the include file
affect whether or not a function inside it will work?



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

Reply via email to