First, you should be using $_GET and NOT be using $HTTP_GET_VARS because its deprecated in the latest PHP version.
Second, you don't need to 'pass' variables to include() files, so it must be some other error in your script. include() and require() are the run-time equivalent of copying the code from anothe rfile and pasting it into your current script.
Third... this shouldnt' even work, this should give you a parse error:
echo "pageid = ".$pageid";
It should be:
echo "pageid = " . $pageid . " ";
Fourth, use <?php and ?> and NOT use <? ?> shorttags, because those arn't always enabled on all hosts. It's just a good practice to get into.