Lets say we have 3 files: File1.php, File2.php, File3.php
I want to have it where in File1.php I include() File2.php. Then in File2.php I include() File3.php. I tested it out by writing test text in File3.php, and when I viewed File1.php I could see that test text.
Now my problem is that if I make a variable, say '$test = "Success!";', in File3.php and then I try to call it in File1.php with 'echo $test;' it outputs nothing. It's not transferring the variables, but it is transferring standard text.
What's going on here?
(P.S. The reason I'm doing it like this is because of organization.)
EDIT
Here's my exact code: (also forgot to mention that I'm grabbing the url of the site first)
file3.php
<?php
$test = "Success!";
file2.php
<?php
include 'http://' . $_SERVER['SERVER_NAME'] . '/file3.php';
file1.php
<?php
include 'http://' . $_SERVER['SERVER_NAME'] . '/file2.php';
echo $test;