Hi guys

simple really..

example...

my index.php has this:

<?php
$active="yes";
include('check.php');
?>

inside this check.php file i have the following code:

<?php echo "$active"; ?>

as simple as it is, nothing is outputted .. is this normal? I would thing that the $active variable's scope extends into the included file.. as the included file simply being run as part of the code right?

What gives? How can i pass $active variable into that block from the include file ?

Tnx

    As posted above, it should work. The only time it would be an issue would be if the variable were local in scope to a function definition in either of the files involved.

      Write a Reply...