Yes, they do work. The variables are available anywhere in the page, no matter how many times you weave in and out of php. Example:
<?
$greeting = "hello";
?>
<b>This is the greeting page</b><br><br>
<?
$name = "danny";
?>
<h1><?= $hello . " " . $name; ?></h1>
That code will print 'hello danny'
You echo/print filename1 three times, then print filename2 once. You should get
index.phpindex.phpindex.phpindex2.php
You're only getting
index2.php????
Cgraz