Click to See Complete Forum and Search --> : Variable from a.include not avail in b.include


jacen6678
08-06-2003, 01:20 AM
I am using the following:
a.include--------
<?php
$BASE_HREF="http://www.yahoo.com";
?>

b.include-------
<?php
echo $BASE_HREF;
?>

webpage.php----
<html...
<?php
include('a.include');
echo $BASE_HREF //echo returns http://www.yahoo.com
include('b.include'); //returns nothing
?>
</html>

What can I do to make the vars in a.include available in b.include?

jacen6678
08-06-2003, 03:35 AM
This is no longer a problem... more of a curiosity. On my webpages, a template includes 2+ files.
-----variables.lib----------
<?php
$BASE_HREF="http://a.b.com";
?>

------content.display-----
<img src="<?php echo $BASE_HREF; ?>/images/some.jpg">

If I use:
----------template----------
<?php
include('library/variables.lib');
include('content.display');
?>
then everything works perfectly

If I use:
----------template----------
<?php
include('library/variables.lib');
include($BASE_HREF.'content.display');
?>
then content.display will still be replaced with an image but $BASE_HREF becomes NULL. Anyone know why that is?