There must be some difference between the older pages that still work and the new pages that don't work. Software may be faulty but it's never capricious. Without knowing what the difference is, I'll offer these suggestions:
Is the path to the included files specified somehow in one set of files, and not the other, or specified differently?
When you include the file inside your class (in a function, presumably), do you then try to echo it in a different function? The variables in a file included inside a function, and the variables inside any function, are local to that function. Even "global" won't change that. Here's a test script to show what I mean:
test.php
$var = 'var';
function define_func_var()
{
$func_var = 'func_var';
include 'include_file.inc';
}
function echo_var()
{
global $var;
define_func_var();
global $func_var;
global $include_var;
echo '$var = ' . $var . '<br />'; // Will be echoed
echo '$func_var = ' . $func_var . '<br />'; // Won't be echoed
echo '$include_var = ' . $include_var . '<br />'; // Won't be echoed
}
class Test
{
function include_file()
{
include 'include_file.inc';
}
function test_echo_var()
{
global $var;
define_func_var();
global $func_var;
global $include_var;
echo '$var = ' . $var . '<br />'; // Will be echoed
echo '$func_var = ' . $func_var . '<br />'; // Won't be echoed
echo '$include_var = ' . $include_var . '<br />'; // Won't be echoed
}
}
echo 'Stand-alone function:' . '<br />';
echo_var();
echo 'Class function:' . '<br />';
$test = new Test;
$test->include_file();
$test->test_echo_var();
include_file.inc
$include_var = 'include_var';
Edit: Improved example script. The outcome is the same.