$ _SERVER ['DOCUMENT_ROOT'] yol çalışmıyor

0 Cevap php

Ben çalışmıyor mutlak yolunu sağlamak için belge kök kullanıyorum. wamp / www / proman / header.php: ben bu yolu echo eğer C olarak çıkıyor. Ben bu sorun ne çalışıyor göreli yol verir?

$path = $_SERVER['DOCUMENT_ROOT']."proman/header.php";

I elaborate my problem here: I have 2 php files data_object.php and user.class.php. user.class.php has an include statement for data_object.php which is relative to user.class.php.These two files are under different directory hierarchy. Now I have to include this user.class.php in various files (like projects.php, links.php) under different hierarchy when I want to create a User() object. The problem is the relative path for file inclusion of data_object.php does work for say projects.php but if I open links.php the error message says it could not open file data_object.php in user.class.php. What I think is for relative inclusion of data_object.php it is considering the path of the file in which user.class.php is included. I am facing such problems in more than one scenarios I have to keep my directory structure the way it is but have to find a way to work with nested includes. I am currently running on a WAMP server but after completion I have to host the solution on a domain. Pls help

0 Cevap