I think I need to make clear that [man]include()[/man] is doing TWO very different things depending on the arguement provided. If the argument is a 'file' reference, the CONTENTS of that file are included verbatim at that point in the current script.
If the arguement is a 'protocol' reference, the RESULT of the protocol fetch is included at that point of the script.
Here's my dumb example.
File getme.php:
if(isset($var1) {$result=1;}
if($result>0) {echo '<p>A result</p>';}
A 'file' reference, test1.php
$var1=0;
include('getme.php');
This results in the following php code:
$var1=0;
if(isset($var1) {$result=1;}
if($result>0) {echo '<p>A result</p>';}
Now a protocol reference, test2.php:
$var1=0;
include('http://www.myweb.com/getme.php');
Which results in this php code:
$var1=0;
#and nothing else!
But with $var1 passed, test3.php:
$var1=0;
include('http://www.myweb.com/getme.php?var1='.$var1);
results in this php code:
$var1=0;
<p>A result</p>
Yes, I know the last is bad code, but that is what happens.
As for your questions, I think it should be clear now that 'protocol' inclusions have no effect upon, and cannot change (directly) variables in the calling script unless the included file actually PRODUCES code that changes the variables. It is a subtle but important difference. Imagine if my IF statment were like so:
if($result>0) { echo '$var1=10;';}
Now in the last example, test3.php the result would be:
$var1=0;
$var1=10;