I have to show a page from my php script based on certain conditions. I have an if condition and am doing an \"include\" if the condition is satisfied.
if(co
An include is just like a code insertion. You get in your included code the exact same variables you have in your base code. So you can do this in your main file :
if ($condition == true)
{
$id = 12345;
include 'myFile.php';
}
?>
And in "myFile.php" :
echo 'My id is : ' . $id . '!';
?>
This will output :
My id is 12345 !