I use the root of the document to provide an absolute path that doesn't work. if I repeat this path it will be C: wamp / www / proman / header.php. I give a relative path, it works fine, what's the problem?
$path = $_SERVER['DOCUMENT_ROOT']."proman/header.php";
I detailed my problem: I have 2 php files data_object.php and user.class.php. user.class.php has an include statement for data_object.php, which refers to user.class.php. These two files are in different directory hierarchies. Now I have to include this user.class.php in various files (e.g. projects.php, links.php) under a different hierarchy when I want to create a User () object. The problem is that the relative path to include the data_object.php file really works for say projects.php, but if I open links.php, the error message says that it cannot open the data_object.php file in user.class.php. I think that for the relative inclusion of data_object.php it considers the path to the file that user.class.php is included in. I encountered such problems in more than one scenario,I need to keep the directory structure as it is, but I need to find a way to work with nested inclusions. I am currently working on a WAMP server, but after completion I have to host the solution in the domain. Pls Help
source
share