quote:
Originally posted by rav0
Apparantly, if in file1.php, you define a something, and then include file2.php, whatever you defined in file1.php doesn't work. file2.php gets processed by itself, and then pasted into file1.php. You will need to define something in file2.php for it to work, you can't define it in file1.php and include file2.php.
That's nonsense.
Or, at least, there's more to it than that.
Quick test... file1.php
code:
<?php
class wdz {
var $lazy = 'very lazy';
}
$wdz = new wdz;
require './file2.php';
?>
file2.php
code:
<?php
echo $wdz->lazy;
?>
Executing file1.php will echo the string as expected.