you may not have url fopen wrappers enabled, which would prevent you from including a file via http. but even if you did, including a file via http wont give you the variables anyway, the php source would be compiled and then included, so you need to include using a path if you want the actual source.
//file.php
<?php
$var = 5;
$var2 = $var * 2;
?>
include("http://www.site.com/file.php");
//nothing is output, source is compiled and executed.
include("/path/to/file.php");
$var becomes available to script as 5. $var2 becomes available as 10. source code is included, it is not executed at time of include.