Reputation: 10575
I am trying to include the File from the above folder . Iam here (www/pf/htdocs/ap) . I want to include a php file from the above www it is dev/libraray/hp.php
i am doing it in this way include_once ('../../../../dev/libraray/hp.php')
but could not do it How could i do it
Upvotes: 0
Views: 287
Reputation: 2023
You should use something like $_SERVER['DOCUMENT_ROOT']
in case you change the locations and folders or define a base path like define('BASE_URL', dirname($_SERVER["file_name"]));
Upvotes: 0
Reputation: 7438
Use the actual server directory path.
ex. include('/home/username/include.php');
Upvotes: 0
Reputation: 10467
include()
string. for this one, removing it once should fix the problem, because you need to go 3 levels down:include_once ('../../../dev/libraray/hp.php')
Upvotes: 2