Hi, I try to configure a php applic to load a config file (the purpose is to
use in all the php pages variables definied in a config file)
Here is a small example which describe my problem:
My config file (test_config.ph p)
<?
$FOO=1;
print "IN REQUIRE FILE: $FOO\n";
?>
The page that require the config file:
<?
print "Hello<bR>\ n";
require "test_config.ph p";
#require "http://servername/test/test_config.php ";
print "<br>FOO from config:$FOO<br> \n";
?>
If I execute it, it works (until the file test_config can be found in the
include_path var defined in the php.ini)
The result is:
---------------
Hello
IN REQUIRE FILE: 1
FOO from config:1
---------------
If I comment the first require and uncomment the second one, PHP execute the
file,
but I can not use the variable ($FOO) definied in the config file
The result is:
---------------
Hello
IN REQUIRE FILE: 1
Notice: Undefined variable: FOO in E:\Web-repository\yca\ dns\test\1.php on
line 5
FOO from config:
---------------
use in all the php pages variables definied in a config file)
Here is a small example which describe my problem:
My config file (test_config.ph p)
<?
$FOO=1;
print "IN REQUIRE FILE: $FOO\n";
?>
The page that require the config file:
<?
print "Hello<bR>\ n";
require "test_config.ph p";
#require "http://servername/test/test_config.php ";
print "<br>FOO from config:$FOO<br> \n";
?>
If I execute it, it works (until the file test_config can be found in the
include_path var defined in the php.ini)
The result is:
---------------
Hello
IN REQUIRE FILE: 1
FOO from config:1
---------------
If I comment the first require and uncomment the second one, PHP execute the
file,
but I can not use the variable ($FOO) definied in the config file
The result is:
---------------
Hello
IN REQUIRE FILE: 1
Notice: Undefined variable: FOO in E:\Web-repository\yca\ dns\test\1.php on
line 5
FOO from config:
---------------
Comment