passing variables to an include file



I have a page, which receives a variable $pageid from another page using the get method. The receiving page needs to use the value of $pageid in an include file which it calls.

I dont seam to be able to get it to work. I can display the value of $pageid at the top of the actual page no problem. But if I use the variable $pageid in the code of the included file it ends up with no value.

Am I doing something wrong.


main page code:

echo "pageid = ".$pageid"; //this displays the value fine
include include.php;

include file code:

echo "pageid = ".$pageid"; //this doesn't display on the page calling the include it comes up "pageid ="

$_GET['pageid'] is the correct method. You have register_globals on so you must user the superglobal instead. (which is the correct way to do it)