[SOLVED] includes and variables
Posted: Tue Aug 03, 2004 3:09 pm
I have a vars.php in the root directory of my web site. This file contains variables that I need to use in nearly every page. The problem is that when I include it the variables are not passed to the file that called it. EG
I tested to see if the file was being included, and yes it is.
How can I include a file in the root directory of my web site and use it's variables without somthing like "../../vars.php"?
Code: Select all
<?php
// include the variables
include( "http://$_SERVER[HTTP_HOST]/vars.php" );
// display the variables
// this is what doesn't work
echo "$blogRoot<br>";
?>How can I include a file in the root directory of my web site and use it's variables without somthing like "../../vars.php"?