Hi all,
I have the following directory structure:
|--index.php
|--connection_parameters.php
|--Includes
|--|--functions.inc.php
index requires functions.inc.php, which in turn requires connection_parameters.php (which is in the root)
the only functions.inc.php works is the following:
function connect_to_db() {
require_once('connection_parameters.php');
(other code here...)
now I have two questions:
1) i would expect the last include to be relative to the file that is calling it.. so shouldn't it be require_once('../connection_parameters.php');
2) I would like to make this relative to the root, butrequire_once('/connection_parameters.php');
(with slash at the beginning, that should point to the root) doesn't work.
can you explain to me why this is happening, please?
thanks
p.