Variable scope with include ()
I have a very simple script that sets a variable then includes a file the echoes the variable out. If both files are in the same directory all works well but if I include the file in a subdirectory it no longer works.
test.php
<?
$topic = "somthing";
include("Abstract_Compositions.php");
?><br><?
include("http://ww1.tsawyers.com/artwork/Abstract_Compositions/Abstract_Compositions.php");
?>
Abstract_Compositions.php
<?
echo"this is topic in sub menu: $topic";
$cat = $topic;
?>
So
Abstract_Compositions.php outputs “this is topic in sub menu: something”
/artwork/Abstract_Compositions/Abstract_Compositions.php” outputs “this is topic in sub menu: “
<edit>
If i call it like this it seems to work
include("artwork/Abstract_Compositions/Abstract_Compositions.php");
</edit>
The variable scope should not be affected by the dir path correct? something In my php.ini affecting this?
http://ww1.tsawyers.com/test.php
Runing Apache/2.0.55 (Win32) PHP/5.1.2
Tim Sawyers